mirror of
https://github.com/alchemy-fr/Phraseanet.git
synced 2025-10-12 12:33:26 +00:00
PHRAS-3256 take in account langage in mail
This commit is contained in:
@@ -130,6 +130,10 @@ class RecoveryService
|
||||
$mail->setButtonUrl($url);
|
||||
$mail->setExpiration($token->getExpiration());
|
||||
|
||||
if (($locale = $user->getLocale()) != null) {
|
||||
$mail->setLocale($locale);
|
||||
}
|
||||
|
||||
$this->mailer->deliver($mail);
|
||||
}
|
||||
|
||||
|
@@ -294,6 +294,12 @@ class SendValidationRemindersCommand extends Command
|
||||
$mail->setButtonUrl($params['url']);
|
||||
$mail->setTitle($title);
|
||||
|
||||
if (($locale = $user_to->getLocale()) != null) {
|
||||
$mail->setLocale($locale);
|
||||
} elseif (($locale1 = $user_from->getLocale()) != null) {
|
||||
$mail->setLocale($locale1);
|
||||
}
|
||||
|
||||
$this->deliver($mail);
|
||||
$mailed = true;
|
||||
|
||||
|
@@ -187,6 +187,10 @@ class UserCreateCommand extends Command
|
||||
$mail->setButtonUrl('http://'.$servername.'/login/renew-password/?token='.$token->getValue());
|
||||
$mail->setLogin($user->getLogin());
|
||||
|
||||
if (($locale = $user->getLocale()) != null) {
|
||||
$mail->setLocale($locale);
|
||||
}
|
||||
|
||||
$this->deliver($mail);
|
||||
}
|
||||
|
||||
@@ -205,6 +209,10 @@ class UserCreateCommand extends Command
|
||||
$mail->setButtonUrl('http://'.$servername.'/login/register-confirm/?code='.$token->getValue());
|
||||
$mail->setExpiration($token->getExpiration());
|
||||
|
||||
if (($locale = $user->getLocale()) != null) {
|
||||
$mail->setLocale($locale);
|
||||
}
|
||||
|
||||
$this->deliver($mail);
|
||||
}
|
||||
|
||||
|
@@ -172,6 +172,10 @@ class UserPasswordCommand extends Command
|
||||
$mail->setLogin($user->getLogin());
|
||||
$mail->setExpiration(new \DateTime('+1 day'));
|
||||
|
||||
if (($locale = $user->getLocale()) != null) {
|
||||
$mail->setLocale($locale);
|
||||
}
|
||||
|
||||
$this->deliver($mail);
|
||||
}
|
||||
|
||||
|
@@ -531,6 +531,10 @@ class UserController extends Controller
|
||||
$receiver = new Receiver(null, $user->getEmail());
|
||||
$mail = MailSuccessEmailUpdate::create($this->app, $receiver, null, $message);
|
||||
|
||||
if (($locale = $user->getLocale()) != null) {
|
||||
$mail->setLocale($locale);
|
||||
}
|
||||
|
||||
$this->deliver($mail);
|
||||
}
|
||||
}
|
||||
|
@@ -76,6 +76,7 @@ class BasketController extends Controller
|
||||
$userFrom = $basket->getValidation()->getInitiator();
|
||||
|
||||
$emitter = Emitter::fromUser($userFrom);
|
||||
$localeFrom = $userFrom->getLocale();
|
||||
|
||||
$params = $request->request->all();
|
||||
$message = $params['reminder-message'];
|
||||
@@ -113,6 +114,12 @@ class BasketController extends Controller
|
||||
$mail->setTitle($basket->getName());
|
||||
$mail->setButtonUrl($url);
|
||||
|
||||
if (($locale = $userTo->getLocale()) != null) {
|
||||
$mail->setLocale($locale);
|
||||
} elseif ($localeFrom != null) {
|
||||
$mail->setLocale($localeFrom);
|
||||
}
|
||||
|
||||
$this->deliver($mail);
|
||||
}
|
||||
|
||||
|
@@ -129,6 +129,10 @@ class AccountController extends Controller
|
||||
$mail->setButtonUrl($url);
|
||||
$mail->setExpiration($token->getExpiration());
|
||||
|
||||
if (($locale = $user->getLocale()) != null) {
|
||||
$mail->setLocale($locale);
|
||||
}
|
||||
|
||||
$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'));
|
||||
@@ -355,6 +359,10 @@ class AccountController extends Controller
|
||||
$mail->setButtonUrl($url);
|
||||
$mail->setExpiration($token->getExpiration());
|
||||
|
||||
if (($locale = $user->getLocale()) != null) {
|
||||
$mail->setLocale($locale);
|
||||
}
|
||||
|
||||
$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'));
|
||||
@@ -546,6 +554,9 @@ class AccountController extends Controller
|
||||
|
||||
$this->app['manipulator.user']->delete($user, [$user->getId() => $oldGrantedBaseIds]);
|
||||
if($mail) {
|
||||
if (($locale = $user->getLocale()) != null) {
|
||||
$mail->setLocale($locale);
|
||||
}
|
||||
$this->deliver($mail);
|
||||
}
|
||||
|
||||
|
@@ -369,11 +369,21 @@ class LoginController extends Controller
|
||||
|
||||
if (count($this->getAclForUser($user)->get_granted_base()) > 0) {
|
||||
$mail = MailSuccessEmailConfirmationRegistered::create($this->app, $receiver);
|
||||
|
||||
if (($locale = $user->getLocale()) != null) {
|
||||
$mail->setLocale($locale);
|
||||
}
|
||||
|
||||
$this->deliver($mail);
|
||||
|
||||
$this->app->addFlash('success', $this->app->trans('Account has been unlocked, you can now login.'));
|
||||
} else {
|
||||
$mail = MailSuccessEmailConfirmationUnregistered::create($this->app, $receiver);
|
||||
|
||||
if (($locale = $user->getLocale()) != null) {
|
||||
$mail->setLocale($locale);
|
||||
}
|
||||
|
||||
$this->deliver($mail);
|
||||
|
||||
$this->app->addFlash('info', $this->app->trans('Account has been unlocked, you still have to wait for admin approval.'));
|
||||
|
@@ -45,6 +45,12 @@ class BasketSubscriber extends AbstractNotificationSubscriber
|
||||
$mail->setBasket($basket);
|
||||
$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());
|
||||
|
||||
$mailed = true;
|
||||
|
@@ -46,6 +46,11 @@ class BridgeSubscriber extends AbstractNotificationSubscriber
|
||||
$mail = MailInfoBridgeUploadFailed::create($this->app, $receiver);
|
||||
$mail->setAdapter($account->get_api()->get_connector()->get_name());
|
||||
$mail->setReason($params['reason']);
|
||||
|
||||
if (($locale = $user->getLocale()) != null) {
|
||||
$mail->setlocale($locale);
|
||||
}
|
||||
|
||||
$this->deliver($mail);
|
||||
$mailed = true;
|
||||
}
|
||||
|
@@ -79,6 +79,10 @@ class FeedEntrySubscriber extends AbstractNotificationSubscriber
|
||||
$mail->setAuthor($entry->getAuthorName());
|
||||
$mail->setTitle($entry->getTitle());
|
||||
|
||||
if (($locale = $token->getUser()->getLocale()) != null) {
|
||||
$mail->setLocale($locale);
|
||||
}
|
||||
|
||||
$this->deliver($mail);
|
||||
$users_emailed[$token->getUser()->getId()] = true;
|
||||
}
|
||||
|
@@ -63,6 +63,11 @@ class LazaretSubscriber extends AbstractNotificationSubscriber
|
||||
|
||||
if ($readyToSend) {
|
||||
$mail = MailInfoRecordQuarantined::create($this->app, $receiver);
|
||||
|
||||
if (($locale = $user->getLocale()) != null) {
|
||||
$mail->setLocale($locale);
|
||||
}
|
||||
|
||||
$this->deliver($mail);
|
||||
$mailed = true;
|
||||
}
|
||||
|
@@ -56,6 +56,10 @@ class RegistrationSubscriber extends AbstractNotificationSubscriber
|
||||
$mail = MailInfoUserRegistered::create($this->app, $receiver);
|
||||
$mail->setRegisteredUser($registeredUser);
|
||||
|
||||
if (($locale = $adminUser->getLocale()) != null) {
|
||||
$mail->setLocale($locale);
|
||||
}
|
||||
|
||||
$this->deliver($mail);
|
||||
|
||||
$mailed = true;
|
||||
@@ -104,11 +108,13 @@ class RegistrationSubscriber extends AbstractNotificationSubscriber
|
||||
|
||||
private function autoregisterEMail(User $to, User $registeredUser)
|
||||
{
|
||||
$locale = ($to->getLocale() != null)? $to->getLocale() : null;
|
||||
|
||||
$body = '';
|
||||
$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 prenom'), $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 nom', [], 'messages', $locale), $registeredUser->getFirstName());
|
||||
$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', [], 'messages', $locale), $registeredUser->getEmail());
|
||||
$body .= sprintf("%s/%s\n", $registeredUser->getJob(), $registeredUser->getCompany());
|
||||
|
||||
$readyToSend = false;
|
||||
@@ -121,6 +127,11 @@ class RegistrationSubscriber extends AbstractNotificationSubscriber
|
||||
|
||||
if ($readyToSend) {
|
||||
$mail = MailInfoSomebodyAutoregistered::create($this->app, $receiver, null, $body);
|
||||
|
||||
if ($locale != null) {
|
||||
$mail->setLocale($locale);
|
||||
}
|
||||
|
||||
$this->deliver($mail);
|
||||
}
|
||||
|
||||
|
@@ -57,6 +57,12 @@ class ValidationSubscriber extends AbstractNotificationSubscriber
|
||||
$mail->setTitle($title);
|
||||
$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());
|
||||
$mailed = true;
|
||||
}
|
||||
@@ -100,6 +106,12 @@ class ValidationSubscriber extends AbstractNotificationSubscriber
|
||||
$mail->setTitle($title);
|
||||
$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);
|
||||
$mailed = true;
|
||||
}
|
||||
|
@@ -679,6 +679,11 @@ class Edit extends \Alchemy\Phrasea\Helper\Helper
|
||||
|
||||
if ($oldReceiver) {
|
||||
$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);
|
||||
}
|
||||
|
||||
@@ -690,6 +695,11 @@ class Edit extends \Alchemy\Phrasea\Helper\Helper
|
||||
|
||||
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]));
|
||||
|
||||
if (($locale = $user->getLocale()) != null) {
|
||||
$mailNewAddress->setLocale($locale);
|
||||
}
|
||||
|
||||
$this->deliver($mailNewAddress);
|
||||
}
|
||||
}
|
||||
|
@@ -195,6 +195,10 @@ class Manage extends Helper
|
||||
$mail->setButtonUrl($this->app->url('login_register_confirm', ['code' => $token->getValue()]));
|
||||
$mail->setExpiration($token->getExpiration());
|
||||
|
||||
if (($locale = $user->getLocale()) != null) {
|
||||
$mail->setLocale($locale);
|
||||
}
|
||||
|
||||
$this->deliver($mail);
|
||||
}
|
||||
|
||||
@@ -208,6 +212,10 @@ class Manage extends Helper
|
||||
$mail->setButtonUrl($this->app->url('login_renew_password', ['token' => $token->getValue()]));
|
||||
$mail->setLogin($user->getLogin());
|
||||
|
||||
if (($locale = $user->getLocale()) != null) {
|
||||
$mail->setLocale($locale);
|
||||
}
|
||||
|
||||
$this->deliver($mail);
|
||||
}
|
||||
}
|
||||
|
@@ -19,6 +19,8 @@ abstract class AbstractMail implements MailInterface
|
||||
{
|
||||
const MAIL_SKIN = 'default';
|
||||
|
||||
/** @var string| null */
|
||||
protected $locale = null;
|
||||
/** @var Application */
|
||||
protected $app;
|
||||
/** @var EmitterInterface */
|
||||
@@ -62,6 +64,7 @@ abstract class AbstractMail implements MailInterface
|
||||
'buttonUrl' => $this->getButtonURL(),
|
||||
'buttonText' => $this->getButtonText(),
|
||||
'mailSkin' => $this->getMailSkin(),
|
||||
'emailLocale' => $this->getLocale()
|
||||
]);
|
||||
}
|
||||
|
||||
@@ -81,6 +84,16 @@ abstract class AbstractMail implements MailInterface
|
||||
return $this->app->url('root');
|
||||
}
|
||||
|
||||
public function getLocale()
|
||||
{
|
||||
return $this->locale;
|
||||
}
|
||||
|
||||
public function setLocale($locale)
|
||||
{
|
||||
$this->locale = $locale;
|
||||
}
|
||||
|
||||
/**
|
||||
* {@inheritdoc}
|
||||
*/
|
||||
|
@@ -45,7 +45,7 @@ class MailInfoBridgeUploadFailed extends AbstractMailWithLink
|
||||
*/
|
||||
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');
|
||||
}
|
||||
|
||||
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());
|
||||
}
|
||||
|
||||
/**
|
||||
|
@@ -34,7 +34,7 @@ class MailInfoNewOrder extends AbstractMail
|
||||
*/
|
||||
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()');
|
||||
}
|
||||
|
||||
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()
|
||||
{
|
||||
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());
|
||||
}
|
||||
|
||||
/**
|
||||
|
@@ -49,7 +49,7 @@ class MailInfoNewPublication extends AbstractMailWithLink
|
||||
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');
|
||||
}
|
||||
|
||||
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()
|
||||
{
|
||||
return $this->app->trans('View on %title%', ['%title%' => $this->getPhraseanetTitle()]);
|
||||
return $this->app->trans('View on %title%', ['%title%' => $this->getPhraseanetTitle()], 'messages', $this->getLocale());
|
||||
}
|
||||
|
||||
/**
|
||||
|
@@ -46,7 +46,7 @@ class MailInfoOrderCancelled extends AbstractMail
|
||||
*/
|
||||
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', [
|
||||
'%user%' => $this->deliverer->getDisplayName(),
|
||||
'%quantity%' => $this->quantity,
|
||||
]);
|
||||
], 'messages', $this->getLocale());
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -72,7 +72,7 @@ class MailInfoOrderCancelled extends AbstractMail
|
||||
*/
|
||||
public function getButtonText()
|
||||
{
|
||||
return $this->app->trans('See my order');
|
||||
return $this->app->trans('See my order', [], 'messages', $this->getLocale());
|
||||
}
|
||||
|
||||
/**
|
||||
|
@@ -51,7 +51,7 @@ class MailInfoOrderDelivered extends AbstractMail
|
||||
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');
|
||||
}
|
||||
|
||||
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()
|
||||
{
|
||||
return $this->app->trans('See my order');
|
||||
return $this->app->trans('See my order', [], 'messages', $this->getLocale());
|
||||
}
|
||||
|
||||
/**
|
||||
|
@@ -46,7 +46,7 @@ class MailInfoPushReceived extends AbstractMailWithLink
|
||||
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
|
||||
$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;
|
||||
}
|
||||
|
||||
@@ -71,7 +71,7 @@ class MailInfoPushReceived extends AbstractMailWithLink
|
||||
*/
|
||||
public function getButtonText()
|
||||
{
|
||||
return $this->app->trans('Watch it online');
|
||||
return $this->app->trans('Watch it online', [], 'messages', $this->getLocale());
|
||||
}
|
||||
|
||||
/**
|
||||
|
@@ -18,7 +18,7 @@ class MailInfoRecordQuarantined extends AbstractMail
|
||||
*/
|
||||
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()
|
||||
{
|
||||
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()
|
||||
{
|
||||
return $this->app->trans('Access quarantine');
|
||||
return $this->app->trans('Access quarantine', [], 'messages', $this->getLocale());
|
||||
}
|
||||
|
||||
/**
|
||||
|
@@ -28,7 +28,7 @@ class MailInfoReminderFeedback extends AbstractMailWithLink
|
||||
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()
|
||||
{
|
||||
return $this->app->trans('Start validation');
|
||||
return $this->app->trans('Start validation', [], 'messages', $this->getLocale());
|
||||
}
|
||||
|
||||
/**
|
||||
|
@@ -18,7 +18,7 @@ class MailInfoSomebodyAutoregistered extends AbstractMailWithLink
|
||||
*/
|
||||
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()
|
||||
{
|
||||
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()
|
||||
{
|
||||
return $this->app->trans('Update the account');
|
||||
return $this->app->trans('Update the account', [], 'messages', $this->getLocale());
|
||||
}
|
||||
|
||||
/**
|
||||
|
@@ -34,7 +34,7 @@ class MailInfoUserRegistered extends AbstractMail
|
||||
*/
|
||||
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');
|
||||
}
|
||||
|
||||
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->getJob(), $this->registeredUser->getCompany());
|
||||
}
|
||||
@@ -56,7 +56,7 @@ class MailInfoUserRegistered extends AbstractMail
|
||||
*/
|
||||
public function getButtonText()
|
||||
{
|
||||
return $this->app->trans('Process the registration');
|
||||
return $this->app->trans('Process the registration', [], 'messages', $this->getLocale());
|
||||
}
|
||||
|
||||
/**
|
||||
|
@@ -56,7 +56,7 @@ class MailInfoValidationDone extends AbstractMailWithLink
|
||||
return $this->app->trans('push::mail:: Rapport de validation de %user% pour %title%', [
|
||||
'%user%' => $this->user->getDisplayName(),
|
||||
'%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', [
|
||||
'%user%' => $this->user->getDisplayName(),
|
||||
]);
|
||||
], 'messages', $this->getLocale());
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -78,7 +78,7 @@ class MailInfoValidationDone extends AbstractMailWithLink
|
||||
*/
|
||||
public function getButtonText()
|
||||
{
|
||||
return $this->app->trans('See validation results');
|
||||
return $this->app->trans('See validation results', [], 'messages', $this->getLocale());
|
||||
}
|
||||
|
||||
/**
|
||||
|
@@ -49,7 +49,7 @@ class MailInfoValidationReminder extends AbstractMailWithLink
|
||||
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', [
|
||||
'%timeLeft%' => isset($this->timeLeft)? $this->timeLeft : ''
|
||||
]);
|
||||
], 'messages', $this->getLocale());
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -67,7 +67,7 @@ class MailInfoValidationReminder extends AbstractMailWithLink
|
||||
*/
|
||||
public function getButtonText()
|
||||
{
|
||||
return $this->app->trans('Start validation');
|
||||
return $this->app->trans('Start validation', [], 'messages', $this->getLocale());
|
||||
}
|
||||
|
||||
/**
|
||||
|
@@ -60,7 +60,7 @@ class MailInfoValidationRequest extends AbstractMailWithLink
|
||||
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 (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 {
|
||||
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()
|
||||
{
|
||||
return $this->app->trans('Start validation');
|
||||
return $this->app->trans('Start validation', [], 'messages', $this->getLocale());
|
||||
}
|
||||
|
||||
/**
|
||||
|
@@ -85,6 +85,21 @@ interface MailInterface
|
||||
*/
|
||||
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
|
||||
*
|
||||
|
@@ -18,7 +18,7 @@ class MailRecordsExport extends AbstractMailWithLink
|
||||
*/
|
||||
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()
|
||||
{
|
||||
return $this->app->trans('Download');
|
||||
return $this->app->trans('Download', [], 'messages', $this->getLocale());
|
||||
}
|
||||
|
||||
/**
|
||||
|
@@ -36,7 +36,7 @@ class MailRequestAccountDelete extends AbstractMailWithLink
|
||||
*/
|
||||
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(),
|
||||
'%urlInstance%' => '<a href="'.$this->getPhraseanetURL().'">'.$this->getPhraseanetURL().'</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()
|
||||
{
|
||||
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());
|
||||
}
|
||||
|
||||
/**
|
||||
|
@@ -18,7 +18,7 @@ class MailRequestEmailConfirmation extends AbstractMailWithLink
|
||||
*/
|
||||
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()
|
||||
{
|
||||
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()
|
||||
{
|
||||
return $this->app->trans('Validate e-mail address');
|
||||
return $this->app->trans('Validate e-mail address', [], 'messages', $this->getLocale());
|
||||
}
|
||||
|
||||
/**
|
||||
|
@@ -18,7 +18,7 @@ class MailRequestEmailUpdate extends AbstractMailWithLink
|
||||
*/
|
||||
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()
|
||||
{
|
||||
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()
|
||||
{
|
||||
return $this->app->trans('Confirm new email address');
|
||||
return $this->app->trans('Confirm new email address', [], 'messages', $this->getLocale());
|
||||
}
|
||||
|
||||
/**
|
||||
|
@@ -33,7 +33,7 @@ class MailRequestPasswordSetup extends AbstractMailWithLink
|
||||
*/
|
||||
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');
|
||||
}
|
||||
|
||||
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"
|
||||
. $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()
|
||||
{
|
||||
return $this->app->trans('Setup my password');
|
||||
return $this->app->trans('Setup my password', [], 'messages', $this->getLocale());
|
||||
}
|
||||
|
||||
/**
|
||||
|
@@ -33,7 +33,7 @@ class MailRequestPasswordUpdate extends AbstractMailWithLink
|
||||
*/
|
||||
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');
|
||||
}
|
||||
|
||||
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"
|
||||
. $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()
|
||||
{
|
||||
return $this->app->trans('Renew password');
|
||||
return $this->app->trans('Renew password', [], 'messages', $this->getLocale());
|
||||
}
|
||||
|
||||
/**
|
||||
|
@@ -18,7 +18,7 @@ class MailSuccessAccountDelete extends AbstractMail
|
||||
*/
|
||||
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()
|
||||
{
|
||||
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());
|
||||
}
|
||||
|
||||
/**
|
||||
|
@@ -18,7 +18,7 @@ class MailSuccessEmailConfirmationRegistered extends AbstractMailWithLink
|
||||
*/
|
||||
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()
|
||||
{
|
||||
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()
|
||||
{
|
||||
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());
|
||||
}
|
||||
|
||||
/**
|
||||
|
@@ -18,7 +18,7 @@ class MailSuccessEmailConfirmationUnregistered extends AbstractMailWithLink
|
||||
*/
|
||||
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()
|
||||
{
|
||||
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"
|
||||
. $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()
|
||||
{
|
||||
return $this->app->trans('Watch my access requests status');
|
||||
return $this->app->trans('Watch my access requests status', [], 'messages', $this->getLocale());
|
||||
}
|
||||
|
||||
/**
|
||||
|
@@ -18,7 +18,7 @@ class MailSuccessEmailUpdate extends AbstractMail
|
||||
*/
|
||||
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()
|
||||
{
|
||||
return sprintf("%s\n%s\n%s",
|
||||
$this->app->trans('Dear %user%,', ['%user%' => $this->receiver->getName()]),
|
||||
$this->app->trans('Your contact email address has been updated'),
|
||||
$this->app->trans('Dear %user%,', ['%user%' => $this->receiver->getName()], 'messages', $this->getLocale()),
|
||||
$this->app->trans('Your contact email address has been updated', [], 'messages', $this->getLocale()),
|
||||
$this->message
|
||||
);
|
||||
}
|
||||
|
@@ -54,6 +54,10 @@ class MailNotifier implements ValidationNotifier
|
||||
|
||||
$mail->setUser($order->getUser());
|
||||
|
||||
if (($locale = $recipient->getLocale()) != null) {
|
||||
$mail->setLocale($locale);
|
||||
}
|
||||
|
||||
$this->getDeliverer()->deliver($mail);
|
||||
}
|
||||
|
||||
@@ -82,6 +86,12 @@ class MailNotifier implements ValidationNotifier
|
||||
$mail->setBasket($basket);
|
||||
$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);
|
||||
}
|
||||
|
||||
@@ -99,6 +109,12 @@ class MailNotifier implements ValidationNotifier
|
||||
$mail->setQuantity($delivery->getQuantity());
|
||||
$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);
|
||||
}
|
||||
}
|
||||
|
@@ -71,6 +71,7 @@ class ExportMailWorker implements WorkerInterface
|
||||
$userRepository = $this->app['repo.users'];
|
||||
|
||||
$user = $userRepository->find($payload['emitterUserId']);
|
||||
$localeEmitter = $user->getLocale();
|
||||
|
||||
/** @var TokenRepository $tokenRepository */
|
||||
$tokenRepository = $this->app['repo.tokens'];
|
||||
@@ -100,12 +101,24 @@ class ExportMailWorker implements WorkerInterface
|
||||
} catch (InvalidArgumentException $e) {
|
||||
continue;
|
||||
}
|
||||
|
||||
$userTo = $userRepository->findByEmail(trim($mail));
|
||||
|
||||
$locale = null;
|
||||
if ($userTo !== null) {
|
||||
$locale = ($userTo->getLocale() != null) ? $userTo->getLocale() : $localeEmitter;
|
||||
}
|
||||
|
||||
$deliverEmails[] = $mail;
|
||||
|
||||
$mail = MailRecordsExport::create($this->app, $receiver, $emitter, $params['textmail']);
|
||||
$mail->setButtonUrl($params['url']);
|
||||
$mail->setExpiration($token->getExpiration());
|
||||
|
||||
if ($locale != null) {
|
||||
$mail->setLocale($locale);
|
||||
}
|
||||
|
||||
$this->deliver($mail, $params['reading_confirm']);
|
||||
|
||||
unset($remaingEmails[$key]);
|
||||
|
@@ -144,6 +144,12 @@ class ValidationReminderWorker implements WorkerInterface
|
||||
$mail->setButtonUrl($params['url']);
|
||||
$mail->setTitle($title);
|
||||
|
||||
if (($locale = $userTo->getLocale()) != null) {
|
||||
$mail->setLocale($locale);
|
||||
} elseif (($locale1 = $userFrom->getLocale()) != null) {
|
||||
$mail->setLocale($locale1);
|
||||
}
|
||||
|
||||
$this->deliver($mail);
|
||||
$mailed = true;
|
||||
|
||||
|
@@ -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;">
|
||||
<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;">
|
||||
{{ '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>
|
||||
</tr>
|
||||
<tr>
|
||||
@@ -112,7 +112,7 @@
|
||||
{% if expiration is not none %}
|
||||
<tr>
|
||||
<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>
|
||||
</tr>
|
||||
{% endif %}
|
||||
@@ -122,7 +122,7 @@
|
||||
</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;">
|
||||
{{ '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>
|
||||
</tr>
|
||||
</table>
|
||||
@@ -131,13 +131,13 @@
|
||||
</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;">
|
||||
{{ 'Message automatique de Phraseanet' | trans }}<br />
|
||||
{{ 'Message automatique de Phraseanet' | trans({}, "messages", emailLocale) }}<br />
|
||||
{% set link %}
|
||||
<a href="{{ phraseanetURL }}" target="_blank" style="font-weight:bold; cursor:pointer; color:#999999;">
|
||||
{{ phraseanetTitle }}
|
||||
</a>
|
||||
{% 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>
|
||||
</tr>
|
||||
</table>
|
||||
|
Reference in New Issue
Block a user