PHRAS-3256 take in account langage in mail

This commit is contained in:
aina esokia
2021-02-03 11:44:42 +03:00
parent 72017ed9a4
commit 215562ab74
45 changed files with 255 additions and 77 deletions

View File

@@ -130,6 +130,10 @@ class RecoveryService
$mail->setButtonUrl($url); $mail->setButtonUrl($url);
$mail->setExpiration($token->getExpiration()); $mail->setExpiration($token->getExpiration());
if (($locale = $user->getLocale()) != null) {
$mail->setLocale($locale);
}
$this->mailer->deliver($mail); $this->mailer->deliver($mail);
} }

View File

@@ -294,6 +294,12 @@ class SendValidationRemindersCommand extends Command
$mail->setButtonUrl($params['url']); $mail->setButtonUrl($params['url']);
$mail->setTitle($title); $mail->setTitle($title);
if (($locale = $user_to->getLocale()) != null) {
$mail->setLocale($locale);
} elseif (($locale1 = $user_from->getLocale()) != null) {
$mail->setLocale($locale1);
}
$this->deliver($mail); $this->deliver($mail);
$mailed = true; $mailed = true;

View File

@@ -187,6 +187,10 @@ class UserCreateCommand extends Command
$mail->setButtonUrl('http://'.$servername.'/login/renew-password/?token='.$token->getValue()); $mail->setButtonUrl('http://'.$servername.'/login/renew-password/?token='.$token->getValue());
$mail->setLogin($user->getLogin()); $mail->setLogin($user->getLogin());
if (($locale = $user->getLocale()) != null) {
$mail->setLocale($locale);
}
$this->deliver($mail); $this->deliver($mail);
} }
@@ -205,6 +209,10 @@ class UserCreateCommand extends Command
$mail->setButtonUrl('http://'.$servername.'/login/register-confirm/?code='.$token->getValue()); $mail->setButtonUrl('http://'.$servername.'/login/register-confirm/?code='.$token->getValue());
$mail->setExpiration($token->getExpiration()); $mail->setExpiration($token->getExpiration());
if (($locale = $user->getLocale()) != null) {
$mail->setLocale($locale);
}
$this->deliver($mail); $this->deliver($mail);
} }

View File

@@ -172,6 +172,10 @@ class UserPasswordCommand extends Command
$mail->setLogin($user->getLogin()); $mail->setLogin($user->getLogin());
$mail->setExpiration(new \DateTime('+1 day')); $mail->setExpiration(new \DateTime('+1 day'));
if (($locale = $user->getLocale()) != null) {
$mail->setLocale($locale);
}
$this->deliver($mail); $this->deliver($mail);
} }

View File

@@ -531,6 +531,10 @@ class UserController extends Controller
$receiver = new Receiver(null, $user->getEmail()); $receiver = new Receiver(null, $user->getEmail());
$mail = MailSuccessEmailUpdate::create($this->app, $receiver, null, $message); $mail = MailSuccessEmailUpdate::create($this->app, $receiver, null, $message);
if (($locale = $user->getLocale()) != null) {
$mail->setLocale($locale);
}
$this->deliver($mail); $this->deliver($mail);
} }
} }

View File

@@ -76,6 +76,7 @@ class BasketController extends Controller
$userFrom = $basket->getValidation()->getInitiator(); $userFrom = $basket->getValidation()->getInitiator();
$emitter = Emitter::fromUser($userFrom); $emitter = Emitter::fromUser($userFrom);
$localeFrom = $userFrom->getLocale();
$params = $request->request->all(); $params = $request->request->all();
$message = $params['reminder-message']; $message = $params['reminder-message'];
@@ -113,6 +114,12 @@ class BasketController extends Controller
$mail->setTitle($basket->getName()); $mail->setTitle($basket->getName());
$mail->setButtonUrl($url); $mail->setButtonUrl($url);
if (($locale = $userTo->getLocale()) != null) {
$mail->setLocale($locale);
} elseif ($localeFrom != null) {
$mail->setLocale($localeFrom);
}
$this->deliver($mail); $this->deliver($mail);
} }

View File

@@ -129,6 +129,10 @@ class AccountController extends Controller
$mail->setButtonUrl($url); $mail->setButtonUrl($url);
$mail->setExpiration($token->getExpiration()); $mail->setExpiration($token->getExpiration());
if (($locale = $user->getLocale()) != null) {
$mail->setLocale($locale);
}
$this->deliver($mail); $this->deliver($mail);
$this->app->addFlash('info', $this->app->trans('admin::compte-utilisateur un email de confirmation vient de vous etre envoye. Veuillez suivre les instructions contenue pour continuer')); $this->app->addFlash('info', $this->app->trans('admin::compte-utilisateur un email de confirmation vient de vous etre envoye. Veuillez suivre les instructions contenue pour continuer'));
@@ -355,6 +359,10 @@ class AccountController extends Controller
$mail->setButtonUrl($url); $mail->setButtonUrl($url);
$mail->setExpiration($token->getExpiration()); $mail->setExpiration($token->getExpiration());
if (($locale = $user->getLocale()) != null) {
$mail->setLocale($locale);
}
$this->deliver($mail); $this->deliver($mail);
$this->app->addFlash('info', $this->app->trans('phraseanet::account: A confirmation e-mail has been sent. Please follow the instructions contained to continue account deletion')); $this->app->addFlash('info', $this->app->trans('phraseanet::account: A confirmation e-mail has been sent. Please follow the instructions contained to continue account deletion'));
@@ -546,6 +554,9 @@ class AccountController extends Controller
$this->app['manipulator.user']->delete($user, [$user->getId() => $oldGrantedBaseIds]); $this->app['manipulator.user']->delete($user, [$user->getId() => $oldGrantedBaseIds]);
if($mail) { if($mail) {
if (($locale = $user->getLocale()) != null) {
$mail->setLocale($locale);
}
$this->deliver($mail); $this->deliver($mail);
} }

View File

@@ -369,11 +369,21 @@ class LoginController extends Controller
if (count($this->getAclForUser($user)->get_granted_base()) > 0) { if (count($this->getAclForUser($user)->get_granted_base()) > 0) {
$mail = MailSuccessEmailConfirmationRegistered::create($this->app, $receiver); $mail = MailSuccessEmailConfirmationRegistered::create($this->app, $receiver);
if (($locale = $user->getLocale()) != null) {
$mail->setLocale($locale);
}
$this->deliver($mail); $this->deliver($mail);
$this->app->addFlash('success', $this->app->trans('Account has been unlocked, you can now login.')); $this->app->addFlash('success', $this->app->trans('Account has been unlocked, you can now login.'));
} else { } else {
$mail = MailSuccessEmailConfirmationUnregistered::create($this->app, $receiver); $mail = MailSuccessEmailConfirmationUnregistered::create($this->app, $receiver);
if (($locale = $user->getLocale()) != null) {
$mail->setLocale($locale);
}
$this->deliver($mail); $this->deliver($mail);
$this->app->addFlash('info', $this->app->trans('Account has been unlocked, you still have to wait for admin approval.')); $this->app->addFlash('info', $this->app->trans('Account has been unlocked, you still have to wait for admin approval.'));

View File

@@ -45,6 +45,12 @@ class BasketSubscriber extends AbstractNotificationSubscriber
$mail->setBasket($basket); $mail->setBasket($basket);
$mail->setPusher($user_from); $mail->setPusher($user_from);
if (($locale = $user_to->getLocale()) != null) {
$mail->setLocale($locale);
} elseif (($locale1 = $user_from->getLocale()) != null) {
$mail->setLocale($locale1);
}
$this->deliver($mail, $event->hasReceipt()); $this->deliver($mail, $event->hasReceipt());
$mailed = true; $mailed = true;

View File

@@ -46,6 +46,11 @@ class BridgeSubscriber extends AbstractNotificationSubscriber
$mail = MailInfoBridgeUploadFailed::create($this->app, $receiver); $mail = MailInfoBridgeUploadFailed::create($this->app, $receiver);
$mail->setAdapter($account->get_api()->get_connector()->get_name()); $mail->setAdapter($account->get_api()->get_connector()->get_name());
$mail->setReason($params['reason']); $mail->setReason($params['reason']);
if (($locale = $user->getLocale()) != null) {
$mail->setlocale($locale);
}
$this->deliver($mail); $this->deliver($mail);
$mailed = true; $mailed = true;
} }

View File

@@ -79,6 +79,10 @@ class FeedEntrySubscriber extends AbstractNotificationSubscriber
$mail->setAuthor($entry->getAuthorName()); $mail->setAuthor($entry->getAuthorName());
$mail->setTitle($entry->getTitle()); $mail->setTitle($entry->getTitle());
if (($locale = $token->getUser()->getLocale()) != null) {
$mail->setLocale($locale);
}
$this->deliver($mail); $this->deliver($mail);
$users_emailed[$token->getUser()->getId()] = true; $users_emailed[$token->getUser()->getId()] = true;
} }

View File

@@ -63,6 +63,11 @@ class LazaretSubscriber extends AbstractNotificationSubscriber
if ($readyToSend) { if ($readyToSend) {
$mail = MailInfoRecordQuarantined::create($this->app, $receiver); $mail = MailInfoRecordQuarantined::create($this->app, $receiver);
if (($locale = $user->getLocale()) != null) {
$mail->setLocale($locale);
}
$this->deliver($mail); $this->deliver($mail);
$mailed = true; $mailed = true;
} }

View File

@@ -56,6 +56,10 @@ class RegistrationSubscriber extends AbstractNotificationSubscriber
$mail = MailInfoUserRegistered::create($this->app, $receiver); $mail = MailInfoUserRegistered::create($this->app, $receiver);
$mail->setRegisteredUser($registeredUser); $mail->setRegisteredUser($registeredUser);
if (($locale = $adminUser->getLocale()) != null) {
$mail->setLocale($locale);
}
$this->deliver($mail); $this->deliver($mail);
$mailed = true; $mailed = true;
@@ -104,11 +108,13 @@ class RegistrationSubscriber extends AbstractNotificationSubscriber
private function autoregisterEMail(User $to, User $registeredUser) private function autoregisterEMail(User $to, User $registeredUser)
{ {
$locale = ($to->getLocale() != null)? $to->getLocale() : null;
$body = ''; $body = '';
$body .= sprintf("Login : %s\n", $registeredUser->getLogin()); $body .= sprintf("Login : %s\n", $registeredUser->getLogin());
$body .= sprintf("%s : %s\n", $this->app->trans('admin::compte-utilisateur nom'), $registeredUser->getFirstName()); $body .= sprintf("%s : %s\n", $this->app->trans('admin::compte-utilisateur nom', [], 'messages', $locale), $registeredUser->getFirstName());
$body .= sprintf("%s : %s\n", $this->app->trans('admin::compte-utilisateur prenom'), $registeredUser->getLastName()); $body .= sprintf("%s : %s\n", $this->app->trans('admin::compte-utilisateur prenom', [], 'messages', $locale), $registeredUser->getLastName());
$body .= sprintf("%s : %s\n", $this->app->trans('admin::compte-utilisateur email'), $registeredUser->getEmail()); $body .= sprintf("%s : %s\n", $this->app->trans('admin::compte-utilisateur email', [], 'messages', $locale), $registeredUser->getEmail());
$body .= sprintf("%s/%s\n", $registeredUser->getJob(), $registeredUser->getCompany()); $body .= sprintf("%s/%s\n", $registeredUser->getJob(), $registeredUser->getCompany());
$readyToSend = false; $readyToSend = false;
@@ -121,6 +127,11 @@ class RegistrationSubscriber extends AbstractNotificationSubscriber
if ($readyToSend) { if ($readyToSend) {
$mail = MailInfoSomebodyAutoregistered::create($this->app, $receiver, null, $body); $mail = MailInfoSomebodyAutoregistered::create($this->app, $receiver, null, $body);
if ($locale != null) {
$mail->setLocale($locale);
}
$this->deliver($mail); $this->deliver($mail);
} }

View File

@@ -57,6 +57,12 @@ class ValidationSubscriber extends AbstractNotificationSubscriber
$mail->setTitle($title); $mail->setTitle($title);
$mail->setUser($user_from); $mail->setUser($user_from);
if (($locale = $user_to->getLocale()) != null) {
$mail->setLocale($locale);
} elseif (($locale1 = $user_from->getLocale()) != null) {
$mail->setLocale($locale1);
}
$this->deliver($mail, $event->hasReceipt()); $this->deliver($mail, $event->hasReceipt());
$mailed = true; $mailed = true;
} }
@@ -100,6 +106,12 @@ class ValidationSubscriber extends AbstractNotificationSubscriber
$mail->setTitle($title); $mail->setTitle($title);
$mail->setUser($user_from); $mail->setUser($user_from);
if (($locale = $user_to->getLocale()) != null) {
$mail->setLocale($locale);
} elseif (($locale1 = $user_from->getLocale()) != null) {
$mail->setLocale($locale1);
}
$this->deliver($mail); $this->deliver($mail);
$mailed = true; $mailed = true;
} }

View File

@@ -679,6 +679,11 @@ class Edit extends \Alchemy\Phrasea\Helper\Helper
if ($oldReceiver) { if ($oldReceiver) {
$mailOldAddress = MailSuccessEmailUpdate::create($this->app, $oldReceiver, null, $this->app->trans('You will now receive notifications at %new_email%', ['%new_email%' => $new_email])); $mailOldAddress = MailSuccessEmailUpdate::create($this->app, $oldReceiver, null, $this->app->trans('You will now receive notifications at %new_email%', ['%new_email%' => $new_email]));
if (($locale = $user->getLocale()) != null) {
$mailOldAddress->setLocale($locale);
}
$this->deliver($mailOldAddress); $this->deliver($mailOldAddress);
} }
@@ -690,6 +695,11 @@ class Edit extends \Alchemy\Phrasea\Helper\Helper
if ($newReceiver) { if ($newReceiver) {
$mailNewAddress = MailSuccessEmailUpdate::create($this->app, $newReceiver, null, $this->app->trans('You will no longer receive notifications at %old_email%', ['%old_email%' => $old_email])); $mailNewAddress = MailSuccessEmailUpdate::create($this->app, $newReceiver, null, $this->app->trans('You will no longer receive notifications at %old_email%', ['%old_email%' => $old_email]));
if (($locale = $user->getLocale()) != null) {
$mailNewAddress->setLocale($locale);
}
$this->deliver($mailNewAddress); $this->deliver($mailNewAddress);
} }
} }

View File

@@ -195,6 +195,10 @@ class Manage extends Helper
$mail->setButtonUrl($this->app->url('login_register_confirm', ['code' => $token->getValue()])); $mail->setButtonUrl($this->app->url('login_register_confirm', ['code' => $token->getValue()]));
$mail->setExpiration($token->getExpiration()); $mail->setExpiration($token->getExpiration());
if (($locale = $user->getLocale()) != null) {
$mail->setLocale($locale);
}
$this->deliver($mail); $this->deliver($mail);
} }
@@ -208,6 +212,10 @@ class Manage extends Helper
$mail->setButtonUrl($this->app->url('login_renew_password', ['token' => $token->getValue()])); $mail->setButtonUrl($this->app->url('login_renew_password', ['token' => $token->getValue()]));
$mail->setLogin($user->getLogin()); $mail->setLogin($user->getLogin());
if (($locale = $user->getLocale()) != null) {
$mail->setLocale($locale);
}
$this->deliver($mail); $this->deliver($mail);
} }
} }

View File

@@ -19,6 +19,8 @@ abstract class AbstractMail implements MailInterface
{ {
const MAIL_SKIN = 'default'; const MAIL_SKIN = 'default';
/** @var string| null */
protected $locale = null;
/** @var Application */ /** @var Application */
protected $app; protected $app;
/** @var EmitterInterface */ /** @var EmitterInterface */
@@ -62,6 +64,7 @@ abstract class AbstractMail implements MailInterface
'buttonUrl' => $this->getButtonURL(), 'buttonUrl' => $this->getButtonURL(),
'buttonText' => $this->getButtonText(), 'buttonText' => $this->getButtonText(),
'mailSkin' => $this->getMailSkin(), 'mailSkin' => $this->getMailSkin(),
'emailLocale' => $this->getLocale()
]); ]);
} }
@@ -81,6 +84,16 @@ abstract class AbstractMail implements MailInterface
return $this->app->url('root'); return $this->app->url('root');
} }
public function getLocale()
{
return $this->locale;
}
public function setLocale($locale)
{
$this->locale = $locale;
}
/** /**
* {@inheritdoc} * {@inheritdoc}
*/ */

View File

@@ -45,7 +45,7 @@ class MailInfoBridgeUploadFailed extends AbstractMailWithLink
*/ */
public function getSubject() public function getSubject()
{ {
return $this->app->trans('Upload failed on %application%', ['%application%' => $this->getPhraseanetTitle()]); return $this->app->trans('Upload failed on %application%', ['%application%' => $this->getPhraseanetTitle()], 'messages', $this->getLocale());
} }
/** /**
@@ -60,7 +60,7 @@ class MailInfoBridgeUploadFailed extends AbstractMailWithLink
throw new LogicException('You must set a reason before calling getMessage'); throw new LogicException('You must set a reason before calling getMessage');
} }
return $this->app->trans('An upload on %bridge_adapter% failed, the resaon is : %reason%', ['%bridge_adapter%' => $this->adapter, '%reason%' => $this->reason]); return $this->app->trans('An upload on %bridge_adapter% failed, the resaon is : %reason%', ['%bridge_adapter%' => $this->adapter, '%reason%' => $this->reason], 'messages', $this->getLocale());
} }
/** /**

View File

@@ -34,7 +34,7 @@ class MailInfoNewOrder extends AbstractMail
*/ */
public function getSubject() public function getSubject()
{ {
return $this->app->trans('admin::register: Nouvelle commande sur %application%', ['%application%' => $this->getPhraseanetTitle()]); return $this->app->trans('admin::register: Nouvelle commande sur %application%', ['%application%' => $this->getPhraseanetTitle()], 'messages', $this->getLocale());
} }
/** /**
@@ -46,7 +46,7 @@ class MailInfoNewOrder extends AbstractMail
throw new LogicException('You must set a user before calling getMessage()'); throw new LogicException('You must set a user before calling getMessage()');
} }
return $this->app->trans('%user% has ordered documents', ['%user%' => $this->user->getDisplayName()]); return $this->app->trans('%user% has ordered documents', ['%user%' => $this->user->getDisplayName()], 'messages', $this->getLocale());
} }
/** /**
@@ -54,7 +54,7 @@ class MailInfoNewOrder extends AbstractMail
*/ */
public function getButtonText() public function getButtonText()
{ {
return $this->app->trans('Review order on %website%', ['%website%' => $this->getPhraseanetTitle()]); return $this->app->trans('Review order on %website%', ['%website%' => $this->getPhraseanetTitle()], 'messages', $this->getLocale());
} }
/** /**

View File

@@ -49,7 +49,7 @@ class MailInfoNewPublication extends AbstractMailWithLink
throw new LogicException('You must set an title before calling getMessage'); throw new LogicException('You must set an title before calling getMessage');
} }
return $this->app->trans('Nouvelle publication : %title%', ['%title%' => $this->title]); return $this->app->trans('Nouvelle publication : %title%', ['%title%' => $this->title], 'messages', $this->getLocale());
} }
/** /**
@@ -64,7 +64,7 @@ class MailInfoNewPublication extends AbstractMailWithLink
throw new LogicException('You must set an title before calling getMessage'); throw new LogicException('You must set an title before calling getMessage');
} }
return $this->app->trans('%user% vient de publier %title%', ['%user%' => $this->author, '%title%' => $this->title]); return $this->app->trans('%user% vient de publier %title%', ['%user%' => $this->author, '%title%' => $this->title], 'messages', $this->getLocale());
} }
/** /**
@@ -72,7 +72,7 @@ class MailInfoNewPublication extends AbstractMailWithLink
*/ */
public function getButtonText() public function getButtonText()
{ {
return $this->app->trans('View on %title%', ['%title%' => $this->getPhraseanetTitle()]); return $this->app->trans('View on %title%', ['%title%' => $this->getPhraseanetTitle()], 'messages', $this->getLocale());
} }
/** /**

View File

@@ -46,7 +46,7 @@ class MailInfoOrderCancelled extends AbstractMail
*/ */
public function getSubject() public function getSubject()
{ {
return $this->app->trans('push::mail:: Refus d\'elements de votre commande'); return $this->app->trans('push::mail:: Refus d\'elements de votre commande', [], 'messages', $this->getLocale());
} }
/** /**
@@ -64,7 +64,7 @@ class MailInfoOrderCancelled extends AbstractMail
return $this->app->trans('%user% a refuse %quantity% elements de votre commande', [ return $this->app->trans('%user% a refuse %quantity% elements de votre commande', [
'%user%' => $this->deliverer->getDisplayName(), '%user%' => $this->deliverer->getDisplayName(),
'%quantity%' => $this->quantity, '%quantity%' => $this->quantity,
]); ], 'messages', $this->getLocale());
} }
/** /**
@@ -72,7 +72,7 @@ class MailInfoOrderCancelled extends AbstractMail
*/ */
public function getButtonText() public function getButtonText()
{ {
return $this->app->trans('See my order'); return $this->app->trans('See my order', [], 'messages', $this->getLocale());
} }
/** /**

View File

@@ -51,7 +51,7 @@ class MailInfoOrderDelivered extends AbstractMail
throw new LogicException('You must set a basket before calling getSubject'); throw new LogicException('You must set a basket before calling getSubject');
} }
return $this->app->trans('push::mail:: Reception de votre commande %title%', ['%title%' => $this->basket->getName()]); return $this->app->trans('push::mail:: Reception de votre commande %title%', ['%title%' => $this->basket->getName()], 'messages', $this->getLocale());
} }
/** /**
@@ -63,7 +63,7 @@ class MailInfoOrderDelivered extends AbstractMail
throw new LogicException('You must set a deliverer before calling getMessage'); throw new LogicException('You must set a deliverer before calling getMessage');
} }
return $this->app->trans('%user% vous a delivre votre commande, consultez la en ligne a l\'adresse suivante', ['%user%' => $this->deliverer->getDisplayName()]); return $this->app->trans('%user% vous a delivre votre commande, consultez la en ligne a l\'adresse suivante', ['%user%' => $this->deliverer->getDisplayName()], 'messages', $this->getLocale());
} }
/** /**
@@ -71,7 +71,7 @@ class MailInfoOrderDelivered extends AbstractMail
*/ */
public function getButtonText() public function getButtonText()
{ {
return $this->app->trans('See my order'); return $this->app->trans('See my order', [], 'messages', $this->getLocale());
} }
/** /**

View File

@@ -46,7 +46,7 @@ class MailInfoPushReceived extends AbstractMailWithLink
throw new LogicException('You must set a basket before calling getSubject'); throw new LogicException('You must set a basket before calling getSubject');
} }
return $this->app->trans('Reception of %basket_name%', ['%basket_name%' => $this->basket->getName()]); return $this->app->trans('Reception of %basket_name%', ['%basket_name%' => $this->basket->getName()], 'messages', $this->getLocale());
} }
/** /**
@@ -62,7 +62,7 @@ class MailInfoPushReceived extends AbstractMailWithLink
} }
return return
$this->app->trans('You just received a push containing %quantity% documents from %user%', ['%quantity%' => count($this->basket->getElements()), '%user%' => $this->pusher->getDisplayName()]) $this->app->trans('You just received a push containing %quantity% documents from %user%', ['%quantity%' => count($this->basket->getElements()), '%user%' => $this->pusher->getDisplayName()], 'messages', $this->getLocale())
. "\n" . $this->message; . "\n" . $this->message;
} }
@@ -71,7 +71,7 @@ class MailInfoPushReceived extends AbstractMailWithLink
*/ */
public function getButtonText() public function getButtonText()
{ {
return $this->app->trans('Watch it online'); return $this->app->trans('Watch it online', [], 'messages', $this->getLocale());
} }
/** /**

View File

@@ -18,7 +18,7 @@ class MailInfoRecordQuarantined extends AbstractMail
*/ */
public function getSubject() public function getSubject()
{ {
return $this->app->trans('A document has been quarantined'); return $this->app->trans('A document has been quarantined', [], 'messages', $this->getLocale());
} }
/** /**
@@ -26,7 +26,7 @@ class MailInfoRecordQuarantined extends AbstractMail
*/ */
public function getMessage() public function getMessage()
{ {
return $this->app->trans('A file has been thrown to the quarantine.'); return $this->app->trans('A file has been thrown to the quarantine.', [], 'messages', $this->getLocale());
} }
/** /**
@@ -34,7 +34,7 @@ class MailInfoRecordQuarantined extends AbstractMail
*/ */
public function getButtonText() public function getButtonText()
{ {
return $this->app->trans('Access quarantine'); return $this->app->trans('Access quarantine', [], 'messages', $this->getLocale());
} }
/** /**

View File

@@ -28,7 +28,7 @@ class MailInfoReminderFeedback extends AbstractMailWithLink
throw new LogicException('You must set an title before calling getSubject'); throw new LogicException('You must set an title before calling getSubject');
} }
return $this->app->trans("Manual feedback Reminder : '%title%'", ['%title%' => $this->title]); return $this->app->trans("Manual feedback Reminder : '%title%'", ['%title%' => $this->title], 'messages', $this->getLocale());
} }
/** /**
@@ -44,7 +44,7 @@ class MailInfoReminderFeedback extends AbstractMailWithLink
*/ */
public function getButtonText() public function getButtonText()
{ {
return $this->app->trans('Start validation'); return $this->app->trans('Start validation', [], 'messages', $this->getLocale());
} }
/** /**

View File

@@ -18,7 +18,7 @@ class MailInfoSomebodyAutoregistered extends AbstractMailWithLink
*/ */
public function getSubject() public function getSubject()
{ {
return $this->app->trans('admin::register: Inscription automatique sur %application%', ['%application%' => $this->getPhraseanetTitle()]); return $this->app->trans('admin::register: Inscription automatique sur %application%', ['%application%' => $this->getPhraseanetTitle()], 'messages', $this->getLocale());
} }
/** /**
@@ -26,7 +26,7 @@ class MailInfoSomebodyAutoregistered extends AbstractMailWithLink
*/ */
public function getMessage() public function getMessage()
{ {
return $this->app->trans('admin::register: un utilisateur s\'est inscrit')."\n\n".$this->message; return $this->app->trans('admin::register: un utilisateur s\'est inscrit', [], 'messages', $this->getLocale())."\n\n".$this->message;
} }
/** /**
@@ -34,7 +34,7 @@ class MailInfoSomebodyAutoregistered extends AbstractMailWithLink
*/ */
public function getButtonText() public function getButtonText()
{ {
return $this->app->trans('Update the account'); return $this->app->trans('Update the account', [], 'messages', $this->getLocale());
} }
/** /**

View File

@@ -34,7 +34,7 @@ class MailInfoUserRegistered extends AbstractMail
*/ */
public function getSubject() public function getSubject()
{ {
return $this->app->trans('admin::register: demande d\'inscription sur %application%', ['%application%' => $this->getPhraseanetTitle()]); return $this->app->trans('admin::register: demande d\'inscription sur %application%', ['%application%' => $this->getPhraseanetTitle()], 'messages', $this->getLocale());
} }
/** /**
@@ -46,7 +46,7 @@ class MailInfoUserRegistered extends AbstractMail
throw new LogicException('You must set a user before calling getMessage'); throw new LogicException('You must set a user before calling getMessage');
} }
return $this->app->trans('admin::register: un utilisateur a fait une demande d\'inscription') return $this->app->trans('admin::register: un utilisateur a fait une demande d\'inscription', [], 'messages', $this->getLocale())
. "\n\n" . sprintf('%s %s',$this->registeredUser->getFirstName(), $this->registeredUser->getLastName()) . "\n\n" . sprintf('%s %s',$this->registeredUser->getFirstName(), $this->registeredUser->getLastName())
. "\n\n" . sprintf('%s %s',$this->registeredUser->getJob(), $this->registeredUser->getCompany()); . "\n\n" . sprintf('%s %s',$this->registeredUser->getJob(), $this->registeredUser->getCompany());
} }
@@ -56,7 +56,7 @@ class MailInfoUserRegistered extends AbstractMail
*/ */
public function getButtonText() public function getButtonText()
{ {
return $this->app->trans('Process the registration'); return $this->app->trans('Process the registration', [], 'messages', $this->getLocale());
} }
/** /**

View File

@@ -56,7 +56,7 @@ class MailInfoValidationDone extends AbstractMailWithLink
return $this->app->trans('push::mail:: Rapport de validation de %user% pour %title%', [ return $this->app->trans('push::mail:: Rapport de validation de %user% pour %title%', [
'%user%' => $this->user->getDisplayName(), '%user%' => $this->user->getDisplayName(),
'%title%' => $this->title, '%title%' => $this->title,
]); ], 'messages', $this->getLocale());
} }
/** /**
@@ -70,7 +70,7 @@ class MailInfoValidationDone extends AbstractMailWithLink
return $this->app->trans('%user% has just sent its validation report, you can now see it', [ return $this->app->trans('%user% has just sent its validation report, you can now see it', [
'%user%' => $this->user->getDisplayName(), '%user%' => $this->user->getDisplayName(),
]); ], 'messages', $this->getLocale());
} }
/** /**
@@ -78,7 +78,7 @@ class MailInfoValidationDone extends AbstractMailWithLink
*/ */
public function getButtonText() public function getButtonText()
{ {
return $this->app->trans('See validation results'); return $this->app->trans('See validation results', [], 'messages', $this->getLocale());
} }
/** /**

View File

@@ -49,7 +49,7 @@ class MailInfoValidationReminder extends AbstractMailWithLink
throw new LogicException('You must set an title before calling getSubject'); throw new LogicException('You must set an title before calling getSubject');
} }
return $this->app->trans("Reminder : validate '%title%'", ['%title%' => $this->title]); return $this->app->trans("Reminder : validate '%title%'", ['%title%' => $this->title], 'messages', $this->getLocale());
} }
/** /**
@@ -59,7 +59,7 @@ class MailInfoValidationReminder extends AbstractMailWithLink
{ {
return $this->app->trans('Il ne vous reste plus que %timeLeft% pour terminer votre validation', [ return $this->app->trans('Il ne vous reste plus que %timeLeft% pour terminer votre validation', [
'%timeLeft%' => isset($this->timeLeft)? $this->timeLeft : '' '%timeLeft%' => isset($this->timeLeft)? $this->timeLeft : ''
]); ], 'messages', $this->getLocale());
} }
/** /**
@@ -67,7 +67,7 @@ class MailInfoValidationReminder extends AbstractMailWithLink
*/ */
public function getButtonText() public function getButtonText()
{ {
return $this->app->trans('Start validation'); return $this->app->trans('Start validation', [], 'messages', $this->getLocale());
} }
/** /**

View File

@@ -60,7 +60,7 @@ class MailInfoValidationRequest extends AbstractMailWithLink
throw new LogicException('You must set a title before calling getSubject'); throw new LogicException('You must set a title before calling getSubject');
} }
return $this->app->trans("Validation request from %user% for '%title%'", ['%user%' => $this->user->getDisplayName(), '%title%' => $this->title]); return $this->app->trans("Validation request from %user% for '%title%'", ['%user%' => $this->user->getDisplayName(), '%title%' => $this->title], 'messages', $this->getLocale());
} }
/** /**
@@ -70,9 +70,9 @@ class MailInfoValidationRequest extends AbstractMailWithLink
{ {
if (0 < $this->duration) { if (0 < $this->duration) {
if (1 < $this->duration) { if (1 < $this->duration) {
return $this->message . "\n\n" . $this->app->trans("You have %quantity% days to validate the selection.", ['%quantity%' => $this->duration]); return $this->message . "\n\n" . $this->app->trans("You have %quantity% days to validate the selection.", ['%quantity%' => $this->duration], 'messages', $this->getLocale());
} else { } else {
return $this->message . "\n\n" . $this->app->trans("You have 1 day to validate the selection."); return $this->message . "\n\n" . $this->app->trans("You have 1 day to validate the selection.", [], 'messages', $this->getLocale());
} }
} }
@@ -84,7 +84,7 @@ class MailInfoValidationRequest extends AbstractMailWithLink
*/ */
public function getButtonText() public function getButtonText()
{ {
return $this->app->trans('Start validation'); return $this->app->trans('Start validation', [], 'messages', $this->getLocale());
} }
/** /**

View File

@@ -85,6 +85,21 @@ interface MailInterface
*/ */
public function getPhraseanetURL(); public function getPhraseanetURL();
/**
* Set the locale for the email text
*
* @param $locale
* @return string
*/
public function setLocale($locale);
/**
* Get the locale
*
* @return string
*/
public function getLocale();
/** /**
* Returns an URL for a logo * Returns an URL for a logo
* *

View File

@@ -18,7 +18,7 @@ class MailRecordsExport extends AbstractMailWithLink
*/ */
public function getSubject() public function getSubject()
{ {
return $this->app->trans('Vous avez recu des documents'); return $this->app->trans('Vous avez recu des documents', [], 'messages', $this->getLocale());
} }
/** /**
@@ -34,7 +34,7 @@ class MailRecordsExport extends AbstractMailWithLink
*/ */
public function getButtonText() public function getButtonText()
{ {
return $this->app->trans('Download'); return $this->app->trans('Download', [], 'messages', $this->getLocale());
} }
/** /**

View File

@@ -36,7 +36,7 @@ class MailRequestAccountDelete extends AbstractMailWithLink
*/ */
public function getSubject() public function getSubject()
{ {
return $this->app->trans('Email:deletion:request:subject Delete account confirmation'); return $this->app->trans('Email:deletion:request:subject Delete account confirmation', [], 'messages', $this->getLocale());
} }
/** /**
@@ -57,7 +57,7 @@ class MailRequestAccountDelete extends AbstractMailWithLink
'%lastName%' => $this->user->getLastName(), '%lastName%' => $this->user->getLastName(),
'%urlInstance%' => '<a href="'.$this->getPhraseanetURL().'">'.$this->getPhraseanetURL().'</a>', '%urlInstance%' => '<a href="'.$this->getPhraseanetURL().'">'.$this->getPhraseanetURL().'</a>',
'%resetPassword%' => '<a href="'.$this->app->url('reset_password').'">'.$this->app->url('reset_password').'</a>', '%resetPassword%' => '<a href="'.$this->app->url('reset_password').'">'.$this->app->url('reset_password').'</a>',
]); ], 'messages', $this->getLocale());
} }
/** /**
@@ -65,7 +65,7 @@ class MailRequestAccountDelete extends AbstractMailWithLink
*/ */
public function getButtonText() public function getButtonText()
{ {
return $this->app->trans('Email:deletion:request:textButton Delete my account'); return $this->app->trans('Email:deletion:request:textButton Delete my account', [], 'messages', $this->getLocale());
} }
/** /**

View File

@@ -18,7 +18,7 @@ class MailRequestEmailConfirmation extends AbstractMailWithLink
*/ */
public function getSubject() public function getSubject()
{ {
return $this->app->trans('login::register: sujet email : confirmation de votre adresse email'); return $this->app->trans('login::register: sujet email : confirmation de votre adresse email', [], 'messages', $this->getLocale());
} }
/** /**
@@ -26,7 +26,7 @@ class MailRequestEmailConfirmation extends AbstractMailWithLink
*/ */
public function getMessage() public function getMessage()
{ {
return $this->app->trans('login::register: email confirmation email Pour valider votre inscription a la base de donnees, merci de confirmer votre e-mail en suivant le lien ci-dessous.'); return $this->app->trans('login::register: email confirmation email Pour valider votre inscription a la base de donnees, merci de confirmer votre e-mail en suivant le lien ci-dessous.', [], 'messages', $this->getLocale());
} }
/** /**
@@ -34,7 +34,7 @@ class MailRequestEmailConfirmation extends AbstractMailWithLink
*/ */
public function getButtonText() public function getButtonText()
{ {
return $this->app->trans('Validate e-mail address'); return $this->app->trans('Validate e-mail address', [], 'messages', $this->getLocale());
} }
/** /**

View File

@@ -18,7 +18,7 @@ class MailRequestEmailUpdate extends AbstractMailWithLink
*/ */
public function getSubject() public function getSubject()
{ {
return $this->app->trans('login::register: sujet email : confirmation de votre adresse email'); return $this->app->trans('login::register: sujet email : confirmation de votre adresse email', [], 'messages', $this->getLocale());
} }
/** /**
@@ -26,7 +26,7 @@ class MailRequestEmailUpdate extends AbstractMailWithLink
*/ */
public function getMessage() public function getMessage()
{ {
return $this->app->trans('admin::compte-utilisateur: email changement de mot d\'email Bonjour, nous avons bien recu votre demande de changement d\'adresse e-mail. Pour la confirmer, veuillez suivre le lien qui suit. SI vous recevez ce mail sans l\'avoir sollicite, merci de le detruire et de l\'ignorer.'); return $this->app->trans('admin::compte-utilisateur: email changement de mot d\'email Bonjour, nous avons bien recu votre demande de changement d\'adresse e-mail. Pour la confirmer, veuillez suivre le lien qui suit. SI vous recevez ce mail sans l\'avoir sollicite, merci de le detruire et de l\'ignorer.', [], 'messages', $this->getLocale());
} }
/** /**
@@ -34,7 +34,7 @@ class MailRequestEmailUpdate extends AbstractMailWithLink
*/ */
public function getButtonText() public function getButtonText()
{ {
return $this->app->trans('Confirm new email address'); return $this->app->trans('Confirm new email address', [], 'messages', $this->getLocale());
} }
/** /**

View File

@@ -33,7 +33,7 @@ class MailRequestPasswordSetup extends AbstractMailWithLink
*/ */
public function getSubject() public function getSubject()
{ {
return $this->app->trans('Your account on %application%', ['%application%' => $this->getPhraseanetTitle()]); return $this->app->trans('Your account on %application%', ['%application%' => $this->getPhraseanetTitle()], 'messages', $this->getLocale());
} }
/** /**
@@ -45,9 +45,9 @@ class MailRequestPasswordSetup extends AbstractMailWithLink
throw new LogicException('You must set a login before calling getMessage'); throw new LogicException('You must set a login before calling getMessage');
} }
return $this->app->trans('Your account with the login %login% as been created', ['%login%' => $this->login]) return $this->app->trans('Your account with the login %login% as been created', ['%login%' => $this->login], 'messages', $this->getLocale())
. "\n" . "\n"
. $this->app->trans('You now have to set up your pasword'); . $this->app->trans('You now have to set up your pasword', [], 'messages', $this->getLocale());
} }
/** /**
@@ -55,7 +55,7 @@ class MailRequestPasswordSetup extends AbstractMailWithLink
*/ */
public function getButtonText() public function getButtonText()
{ {
return $this->app->trans('Setup my password'); return $this->app->trans('Setup my password', [], 'messages', $this->getLocale());
} }
/** /**

View File

@@ -33,7 +33,7 @@ class MailRequestPasswordUpdate extends AbstractMailWithLink
*/ */
public function getSubject() public function getSubject()
{ {
return $this->app->trans('login:: Forgot your password'); return $this->app->trans('login:: Forgot your password', [], 'messages', $this->getLocale());
} }
/** /**
@@ -45,9 +45,9 @@ class MailRequestPasswordUpdate extends AbstractMailWithLink
throw new LogicException('You must set a login before calling getMessage'); throw new LogicException('You must set a login before calling getMessage');
} }
return $this->app->trans('Password renewal for login "%login%" has been requested', ['%login%' => $this->login]) return $this->app->trans('Password renewal for login "%login%" has been requested', ['%login%' => $this->login], 'messages', $this->getLocale())
. "\n" . "\n"
. $this->app->trans('login:: Visitez le lien suivant et suivez les instructions pour continuer, sinon ignorez cet email et il ne se passera rien'); . $this->app->trans('login:: Visitez le lien suivant et suivez les instructions pour continuer, sinon ignorez cet email et il ne se passera rien', [], 'messages', $this->getLocale());
} }
/** /**
@@ -55,7 +55,7 @@ class MailRequestPasswordUpdate extends AbstractMailWithLink
*/ */
public function getButtonText() public function getButtonText()
{ {
return $this->app->trans('Renew password'); return $this->app->trans('Renew password', [], 'messages', $this->getLocale());
} }
/** /**

View File

@@ -18,7 +18,7 @@ class MailSuccessAccountDelete extends AbstractMail
*/ */
public function getSubject() public function getSubject()
{ {
return $this->app->trans('Delete account successfull'); return $this->app->trans('Delete account successfull', [], 'messages', $this->getLocale());
} }
/** /**
@@ -26,7 +26,7 @@ class MailSuccessAccountDelete extends AbstractMail
*/ */
public function getMessage() public function getMessage()
{ {
return $this->app->trans('Your phraseanet account on %urlInstance% has been deleted!', ['%urlInstance%' => '<a href="'.$this->getPhraseanetURL().'">'.$this->getPhraseanetURL().'</a>']); return $this->app->trans('Your phraseanet account on %urlInstance% has been deleted!', ['%urlInstance%' => '<a href="'.$this->getPhraseanetURL().'">'.$this->getPhraseanetURL().'</a>'], 'messages', $this->getLocale());
} }
/** /**

View File

@@ -18,7 +18,7 @@ class MailSuccessEmailConfirmationRegistered extends AbstractMailWithLink
*/ */
public function getSubject() public function getSubject()
{ {
return $this->app->trans('Email successfully confirmed'); return $this->app->trans('Email successfully confirmed', [], 'messages', $this->getLocale());
} }
/** /**
@@ -26,7 +26,7 @@ class MailSuccessEmailConfirmationRegistered extends AbstractMailWithLink
*/ */
public function getMessage() public function getMessage()
{ {
return $this->app->trans('login::register: merci d\'avoir confirme votre adresse email'); return $this->app->trans('login::register: merci d\'avoir confirme votre adresse email', [], 'messages', $this->getLocale());
} }
/** /**
@@ -34,7 +34,7 @@ class MailSuccessEmailConfirmationRegistered extends AbstractMailWithLink
*/ */
public function getButtonText() public function getButtonText()
{ {
return $this->app->trans('Your access on %application%', ['%application%' => $this->app['conf']->get(['registry', 'general', 'title'])]); return $this->app->trans('Your access on %application%', ['%application%' => $this->app['conf']->get(['registry', 'general', 'title'])], 'messages', $this->getLocale());
} }
/** /**

View File

@@ -18,7 +18,7 @@ class MailSuccessEmailConfirmationUnregistered extends AbstractMailWithLink
*/ */
public function getSubject() public function getSubject()
{ {
return $this->app->trans('Email successfully confirmed'); return $this->app->trans('Email successfully confirmed', [], 'messages', $this->getLocale());
} }
/** /**
@@ -26,9 +26,9 @@ class MailSuccessEmailConfirmationUnregistered extends AbstractMailWithLink
*/ */
public function getMessage() public function getMessage()
{ {
return $this->app->trans('login::register: merci d\'avoir confirme votre adresse email') return $this->app->trans('login::register: merci d\'avoir confirme votre adresse email', [], 'messages', $this->getLocale())
. "\n" . "\n"
. $this->app->trans("You have to wait for an administrator approval for your access request"); . $this->app->trans("You have to wait for an administrator approval for your access request", [], 'messages', $this->getLocale());
} }
/** /**
@@ -36,7 +36,7 @@ class MailSuccessEmailConfirmationUnregistered extends AbstractMailWithLink
*/ */
public function getButtonText() public function getButtonText()
{ {
return $this->app->trans('Watch my access requests status'); return $this->app->trans('Watch my access requests status', [], 'messages', $this->getLocale());
} }
/** /**

View File

@@ -18,7 +18,7 @@ class MailSuccessEmailUpdate extends AbstractMail
*/ */
public function getSubject() public function getSubject()
{ {
return $this->app->trans('Update of your email address on %application%', ['%application%' => $this->getPhraseanetTitle()]); return $this->app->trans('Update of your email address on %application%', ['%application%' => $this->getPhraseanetTitle()], 'messages', $this->getLocale());
} }
/** /**
@@ -27,8 +27,8 @@ class MailSuccessEmailUpdate extends AbstractMail
public function getMessage() public function getMessage()
{ {
return sprintf("%s\n%s\n%s", return sprintf("%s\n%s\n%s",
$this->app->trans('Dear %user%,', ['%user%' => $this->receiver->getName()]), $this->app->trans('Dear %user%,', ['%user%' => $this->receiver->getName()], 'messages', $this->getLocale()),
$this->app->trans('Your contact email address has been updated'), $this->app->trans('Your contact email address has been updated', [], 'messages', $this->getLocale()),
$this->message $this->message
); );
} }

View File

@@ -54,6 +54,10 @@ class MailNotifier implements ValidationNotifier
$mail->setUser($order->getUser()); $mail->setUser($order->getUser());
if (($locale = $recipient->getLocale()) != null) {
$mail->setLocale($locale);
}
$this->getDeliverer()->deliver($mail); $this->getDeliverer()->deliver($mail);
} }
@@ -82,6 +86,12 @@ class MailNotifier implements ValidationNotifier
$mail->setBasket($basket); $mail->setBasket($basket);
$mail->setDeliverer($delivery->getAdmin()); $mail->setDeliverer($delivery->getAdmin());
if (($locale = $order->getUser()->getLocale()) != null) {
$mail->setLocale($locale);
} elseif (($locale1 = $delivery->getAdmin()->getLocale()) != null) {
$mail->setLocale($locale1);
}
$this->getDeliverer()->deliver($mail); $this->getDeliverer()->deliver($mail);
} }
@@ -99,6 +109,12 @@ class MailNotifier implements ValidationNotifier
$mail->setQuantity($delivery->getQuantity()); $mail->setQuantity($delivery->getQuantity());
$mail->setDeliverer($delivery->getAdmin()); $mail->setDeliverer($delivery->getAdmin());
if (($locale = $delivery->getOrder()->getUser()->getLocale()) != null) {
$mail->setLocale($locale);
} elseif (($locale1 = $delivery->getAdmin()->getLocale()) != null) {
$mail->setLocale($locale1);
}
$this->getDeliverer()->deliver($mail); $this->getDeliverer()->deliver($mail);
} }
} }

View File

@@ -71,6 +71,7 @@ class ExportMailWorker implements WorkerInterface
$userRepository = $this->app['repo.users']; $userRepository = $this->app['repo.users'];
$user = $userRepository->find($payload['emitterUserId']); $user = $userRepository->find($payload['emitterUserId']);
$localeEmitter = $user->getLocale();
/** @var TokenRepository $tokenRepository */ /** @var TokenRepository $tokenRepository */
$tokenRepository = $this->app['repo.tokens']; $tokenRepository = $this->app['repo.tokens'];
@@ -100,12 +101,24 @@ class ExportMailWorker implements WorkerInterface
} catch (InvalidArgumentException $e) { } catch (InvalidArgumentException $e) {
continue; continue;
} }
$userTo = $userRepository->findByEmail(trim($mail));
$locale = null;
if ($userTo !== null) {
$locale = ($userTo->getLocale() != null) ? $userTo->getLocale() : $localeEmitter;
}
$deliverEmails[] = $mail; $deliverEmails[] = $mail;
$mail = MailRecordsExport::create($this->app, $receiver, $emitter, $params['textmail']); $mail = MailRecordsExport::create($this->app, $receiver, $emitter, $params['textmail']);
$mail->setButtonUrl($params['url']); $mail->setButtonUrl($params['url']);
$mail->setExpiration($token->getExpiration()); $mail->setExpiration($token->getExpiration());
if ($locale != null) {
$mail->setLocale($locale);
}
$this->deliver($mail, $params['reading_confirm']); $this->deliver($mail, $params['reading_confirm']);
unset($remaingEmails[$key]); unset($remaingEmails[$key]);

View File

@@ -144,6 +144,12 @@ class ValidationReminderWorker implements WorkerInterface
$mail->setButtonUrl($params['url']); $mail->setButtonUrl($params['url']);
$mail->setTitle($title); $mail->setTitle($title);
if (($locale = $userTo->getLocale()) != null) {
$mail->setLocale($locale);
} elseif (($locale1 = $userFrom->getLocale()) != null) {
$mail->setLocale($locale1);
}
$this->deliver($mail); $this->deliver($mail);
$mailed = true; $mailed = true;

View File

@@ -25,7 +25,7 @@
<table width="100%" bgcolor="#f2f2f2;" cellpadding="0" cellspacing="0" border="0" style="margin:0; padding:0; width:100% !important; line-height: 120% !important;background-color:#f2f2f2;"> <table width="100%" bgcolor="#f2f2f2;" cellpadding="0" cellspacing="0" border="0" style="margin:0; padding:0; width:100% !important; line-height: 120% !important;background-color:#f2f2f2;">
<tr> <tr>
<td height="40" valign="center" align="center" style="font-family: Helvetica, Tahoma, Arial, sans-serif; font-size:12px; font-weight:normal; color:#999999;line-height:15px;"> <td height="40" valign="center" align="center" style="font-family: Helvetica, Tahoma, Arial, sans-serif; font-size:12px; font-weight:normal; color:#999999;line-height:15px;">
{{ 'Si cet email contient des liens non cliquables, copiez/collez ces liens dans votre navigateur.' | trans }} {{ 'Si cet email contient des liens non cliquables, copiez/collez ces liens dans votre navigateur.' | trans({}, "messages", emailLocale) }}
</td> </td>
</tr> </tr>
<tr> <tr>
@@ -112,7 +112,7 @@
{% if expiration is not none %} {% if expiration is not none %}
<tr> <tr>
<td height="60" valign="center" align="center" style="font-family: Helvetica, Tahoma, Arial, sans-serif; font-size:13px; line-height:16px; color:#999999;"> <td height="60" valign="center" align="center" style="font-family: Helvetica, Tahoma, Arial, sans-serif; font-size:13px; line-height:16px; color:#999999;">
{{ 'This link is valid until' | trans }} {{ app['date-formatter'].getDate(expiration) }} {{ app['date-formatter'].getTime(expiration) }} {{ 'This link is valid until' | trans({}, "messages", emailLocale) }} {{ app['date-formatter'].getDate(expiration) }} {{ app['date-formatter'].getTime(expiration) }}
</td> </td>
</tr> </tr>
{% endif %} {% endif %}
@@ -122,7 +122,7 @@
</tr> </tr>
<tr> <tr>
<td height="60" valign="center" align="center" style="font-family: Helvetica, Tahoma, Arial, sans-serif; font-size:13px; font-style:italic; color:#dc4848;"> <td height="60" valign="center" align="center" style="font-family: Helvetica, Tahoma, Arial, sans-serif; font-size:13px; font-style:italic; color:#dc4848;">
{{ 'Le contenu de cet email est confidentiel, ne le divulguez pas.' | trans }} {{ 'Le contenu de cet email est confidentiel, ne le divulguez pas.' | trans({}, "messages", emailLocale) }}
</td> </td>
</tr> </tr>
</table> </table>
@@ -131,13 +131,13 @@
</tr> </tr>
<tr> <tr>
<td height="50" valign="center" align="center" style="font-family: Helvetica, Tahoma, Arial, sans-serif; font-size:12px; line-height: 15px; color:#999999;"> <td height="50" valign="center" align="center" style="font-family: Helvetica, Tahoma, Arial, sans-serif; font-size:12px; line-height: 15px; color:#999999;">
{{ 'Message automatique de Phraseanet' | trans }}<br /> {{ 'Message automatique de Phraseanet' | trans({}, "messages", emailLocale) }}<br />
{% set link %} {% set link %}
<a href="{{ phraseanetURL }}" target="_blank" style="font-weight:bold; cursor:pointer; color:#999999;"> <a href="{{ phraseanetURL }}" target="_blank" style="font-weight:bold; cursor:pointer; color:#999999;">
{{ phraseanetTitle }} {{ phraseanetTitle }}
</a> </a>
{% endset %} {% endset %}
{% trans with {'%link%' : link} %}Pour gérer l'envoi d'email automatique, connectez-vous à %link%{% endtrans %} {% trans with {'%link%' : link} from 'messages' into emailLocale %}Pour gérer l'envoi d'email automatique, connectez-vous à %link%{% endtrans %}
</td> </td>
</tr> </tr>
</table> </table>