Skip to content

Commit 6e2ad07

Browse files
authored
feat: new variable for venue address in email ticket template (#294)
* feat: new variable for venue address in email ticket template Signed-off-by: romanetar <roman_ag@hotmail.com> * fix: new variable for venue address in email ticket template Signed-off-by: romanetar <roman_ag@hotmail.com> --------- Signed-off-by: romanetar <roman_ag@hotmail.com>
1 parent 5bed672 commit 6e2ad07

2 files changed

Lines changed: 10 additions & 0 deletions

File tree

app/Jobs/Emails/IMailTemplatesConstants.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -78,6 +78,7 @@ interface IMailTemplatesConstants
7878
const net_selling_price = 'net_selling_price';
7979
const new_category = 'new_category';
8080
const number = 'number';
81+
const main_venue_address = 'main_venue_address';
8182
const old_category = 'old_category';
8283
const order_amount = 'order_amount';
8384
const order_amount_adjusted = 'order_amount_adjusted';

app/Jobs/Emails/Registration/Attendees/SummitAttendeeTicketEmail.php

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@
1818
use Illuminate\Support\Facades\Log;
1919
use libs\utils\FormatUtils;
2020
use models\summit\SummitAttendeeTicket;
21+
use models\summit\SummitVenue;
2122
use SimpleSoftwareIO\QrCode\Facades\QrCode;
2223
/**
2324
* Class SummitAttendeeTicketEmail
@@ -98,6 +99,13 @@ public function __construct(SummitAttendeeTicket $ticket, array $payload = [], ?
9899

99100
$payload[IMailTemplatesConstants::promo_code] = ($ticket->hasPromoCode()) ? $ticket->getPromoCode()->getCode() : '';
100101

102+
$main_venue_addresses = collect($ticket->getOrder()->getSummit()->getMainVenues())
103+
->map(function(SummitVenue $venue) {
104+
return $venue->getAddress1() . ' ' . $venue->getAddress2() . ', ' . $venue->getCity() . ', ' . $venue->getState();
105+
})->toArray();
106+
107+
$payload[IMailTemplatesConstants::main_venue_address] = implode(' - ', $main_venue_addresses);
108+
101109
$support_email = $summit->getSupportEmail();
102110
$payload[IMailTemplatesConstants::support_email] = !empty($support_email) ? $support_email : Config::get("registration.support_email", null);
103111

@@ -196,6 +204,7 @@ public static function getEmailTemplateSchema(): array{
196204
$payload[IMailTemplatesConstants::owner_full_name]['type'] = 'string';
197205
$payload[IMailTemplatesConstants::owner_company]['type'] = 'string';
198206
$payload[IMailTemplatesConstants::promo_code]['type'] = 'string';
207+
$payload[IMailTemplatesConstants::main_venue_address]['type'] = 'string';
199208
$payload[IMailTemplatesConstants::support_email]['type'] = 'string';
200209
$payload[IMailTemplatesConstants::message]['type'] = 'string';
201210

0 commit comments

Comments
 (0)