So, how to modify the default mail ?
Let's look at how to generate members joomla3 contents of the letter,
for example: registered, ... and more.
Basically it is to use PHP's sprintf() function, and with the "letters translated string"
For example file:
COM_USERS_EMAIL_REGISTERED_WITH_ACTIVATION_BODY="Hello %s,\n\nThank you for registering at %s. Your account is created and must be activated before you can use it.\nTo activate the account select the following link or copy-paste it in your browser:\n%s \n\nAfter activation you may login to %s using the following username and password:\n\nUsername: %s\nPassword: %s"
That is content of the letter is to add translation files by sprintf()
So the "parameter" the first %s is "username"
What if I want to modify the contents of the letter is in HTML format
In fact, some want to edit
Must be preset PHPmailer (joomla3 all send a letter with PHPmailer)
The default setting is changed to html
Then how to set it?
There are two directions
$mailer = JFactory::getMailer(); $mailer->isHTML(true); JFactory::$mailer = $mailer;
Suppose we have solved the problem in html format
So how do we modify the template?
the point is
If you have double quotes, remember to change that to "_QQ_"
Thus for example:
COM_USERS_EMAIL_REGISTERED_WITH_ACTIVATION_BODY="<span style="_QQ_"color:red"_QQ_">Hello %s, </span><br>Thank you for registering at %s. Your account is created and must be activated before you can use it.<br>To activate the account select the following link or copy-paste it in your browser:<br>%s <br>After activation you may login to %s using the following username and password:<br>Username: %s<br>Password: %s"
because translation is easy error occurs in use HTML format , if there is an error, the contents of the letter would be empty, empty letters will not be sent, to pay attention to this point.
Almost like this
For your reference Hello, Cheers.