Skip to content

Commit

Permalink
update email subject translation
Browse files Browse the repository at this point in the history
  • Loading branch information
Kerrialn committed Jan 11, 2024
1 parent bf2a1f8 commit 0540678
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 6 deletions.
8 changes: 5 additions & 3 deletions src/Service/EmailService/EmailService.php
Original file line number Diff line number Diff line change
Expand Up @@ -8,13 +8,15 @@
use Symfony\Component\Mailer\Exception\TransportExceptionInterface;
use Symfony\Component\Mailer\MailerInterface;
use Symfony\Component\Mime\Address;
use Symfony\Contracts\Translation\TranslatorInterface;

final readonly class EmailService
{
private const SENDER_EMAIL_ADDRESS = '[email protected]';

public function __construct(
private MailerInterface $mailer
private MailerInterface $mailer,
private TranslatorInterface $translator
) {
}

Expand Down Expand Up @@ -67,7 +69,7 @@ public function sendEventOrgniserInvitationEmail(string $recipientEmailAddress,
public function sendInviteToUserWithoutAccount(string $recipientEmailAddress, array $context = []): void
{
$this->send(
subject: 'email.no-account-participant-invitation.subject',
subject: $this->translator->trans('email.invitation.subject'),
template: '/email/no-account-participant-invitation-email.html.twig',
recipientEmailAddress: $recipientEmailAddress,
context: $context
Expand All @@ -81,7 +83,7 @@ public function sendInviteToUserWithoutAccount(string $recipientEmailAddress, ar
public function sendInviteToUserWithAccount(string $recipientEmailAddress, array $context = []): void
{
$this->send(
subject: 'email.invitation.subject',
subject: $this->translator->trans('email.invitation.subject'),
template: '/email/invitation-email.html.twig',
recipientEmailAddress: $recipientEmailAddress,
context: $context
Expand Down
2 changes: 1 addition & 1 deletion templates/macro/event.macro.twig
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@
</div>
<div>
<div class="lh-1">{{ event.owner.fullName|title }}</div>
<div class="text-muted small">{{ event.createdAt|format_datetime(timezone=regional.regionalSettingValueObject.timezone,pattern=date_time_pattern) }}</div>
<div class="text-muted small">{{ event.createdAt|time_ago }}</div>
</div>
</a>
</div>
Expand Down
3 changes: 1 addition & 2 deletions translations/messages+intl-icu.en.php
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,6 @@
'invitation-text' => '{name} has invited you to {title}, click on the link below to respond to the invitation.',
'number-invited-by-email' => '{count} people have been invited by email',
'show-event' => 'view event',
'email.no-account-participant-invitation.subject' => 'Event Invitation',
'email.invitation.subject' => 'Event Invitation',
'email.invitation.subject' => 'You\'re Invited!',
'token-invitation-text' => 'Hey! Looks like you\'ve been invited to this event by { name } sign up up to let them know if you\'re going.',
];

0 comments on commit 0540678

Please sign in to comment.