'city' => $event['loc_block_id.address_id.city'],
'state_province' => $event['loc_block_id.address_id.state_province_id:label'],
'postal_code' => $event['loc_block_id.address_id.postal_code'],
-
]);
+ $tokens['location']['text/html'] = nl2br(trim($tokens['location']['text/plain']));
$tokens['info_url']['text/html'] = \CRM_Utils_System::url('civicrm/event/info', 'reset=1&id=' . $eventID, TRUE, NULL, FALSE, TRUE);
$tokens['registration_url']['text/html'] = \CRM_Utils_System::url('civicrm/event/register', 'reset=1&id=' . $eventID, TRUE, NULL, FALSE, TRUE);
$tokens['start_date']['text/html'] = !empty($event['start_date']) ? new DateTime($event['start_date']) : '';
<?php
+use Civi\Api4\Address;
use Civi\Api4\LocBlock;
use Civi\Api4\Participant;
use Civi\Api4\Phone;
public function testParticipantOfflineReceipt(string $thousandSeparator): void {
$this->setCurrencySeparators($thousandSeparator);
$this->swapMessageTemplateForTestTemplate('event_offline_receipt', 'text');
+ $this->swapMessageTemplateForTestTemplate('event_offline_receipt', 'html');
$mut = new CiviMailUtils($this, TRUE);
// Create an email associated with the logged in contact
$loggedInContactID = $this->createLoggedInUser();
'contribution.balance_amount|raw string is zero:::Yes',
'contribution.balance_amount|boolean:::No',
'contribution.paid_amount|boolean:::Yes',
+ '<p>Test event type - 1</p>event.location:8 Baker Street<br />
+London,',
+ '$location.address.1.display:<div class="location vcard"><span class="adr"><span class="street-address">8 Baker Street</span><br />
+<span class="extended-address">Upstairs</span><br />
+<span class="locality">London</span>,<br />
+</span></div>',
]);
$this->callAPISuccess('Email', 'delete', ['id' => $email['id']]);
if (!empty($eventParams['is_monetary'])) {
$phone = Phone::create()->setValues(['phone' => 1235, 'phone_type_id:name' => 'Mobile', 'phone_ext' => 456])->execute()->first();
- $locationBlockID = LocBlock::create()->setValues(['phone_id' => $phone['id']])->execute()->first()['id'];
+ $address = Address::create()->setValues(['street_address' => '8 Baker Street', 'supplemental_address_1' => 'Upstairs', 'city' => 'London'])->execute()->first();
+ $locationBlockID = LocBlock::create()->setValues(['phone_id' => $phone['id'], 'address_id' => $address['id']])->execute()->first()['id'];
$event = $this->legacyEventCreatePaid(array_merge([
'name' => 'big',
'amount' => 1550.55,
event.loc_block_id.email_id.email :event@example.com
event.loc_block_id.phone_id.phone :456 789
event.description :event description
-event.location :15 Walton St
+event.location :15 Walton St<br />
Emerald City, Maine 90210
-
event.info_url :' . CRM_Utils_System::url('civicrm/event/info', NULL, TRUE) . '&reset=1&id=1
event.registration_url :' . CRM_Utils_System::url('civicrm/event/register', NULL, TRUE) . '&reset=1&id=1
event.pay_later_receipt :Please transfer funds to our bank account.
$mut->checkMailLog($toCheck);
$tokens = array_keys($this->getEventTokens());
$html = $this->getTokenString($tokens);
- $tokenProcessor->addMessage('html', $html, 'text/plain');
+ $tokenProcessor->addMessage('html', $html, 'text/html');
$tokenProcessor->addRow(['eventId' => $this->ids['Event'][0]]);
$tokenProcessor->evaluate();
$this->assertEquals($expectedEventString, $tokenProcessor->getRow(0)->render('html'));
]);
$html = $this->getTokenString(array_keys($this->getEventTokens()));
- $tokenProcessor->addMessage('html', $html, 'text/plain');
+ $tokenProcessor->addMessage('html', $html, 'text/html');
$tokenProcessor->addRow(['eventId' => $this->ids['Event'][0]]);
$tokenProcessor->evaluate();
$this->assertEquals($expected, $tokenProcessor->getRow(0)->render('html'));
--- /dev/null
+event.location:{event.location}
+$location.address.1.display:{$location.address.1.display|nl2br}
+