Setting Dynamic content for queued messages

Hello All,

In a multilanguage site context, messages are sent in real time translated into the language in use by the user.

I am trying to send site messages from a queue using a cron job.

The case is that the messages are added to queue only in the sourceLanguage.

What I would like is to populate the queue with already translated messages - in the user language according to the locale set in their profile. So users will get messages in their language.

I can’t find a way to do that.

Any tips or hints?

When triggered by events the mails are sent translated to the actual site language.

To get them translated while sending them from queue (cron job), I have created a template for each language and adjusted my code to select the appropriate template according to the locale stored in the userProfile.

This works fine.

Others may want to give a try to this extension

I did not test it, but it looks like a solution.