5

I'm sure I've read somewhere how to do this but I am not able to find it at the moment.

I have Postmaster installed, and I am using that to send various emails based on entry creations and status changes.

This all works great, and I have a customised template (with inline css) to produce a nice looking email.

Now I would like to customise the system messages, (i.e new member regs, activation links etc.)

I know there is the Email Notification Templates under the Design>Message Pages option, and these templates produce plain text simple emails.

Is there a way to customise these? Ive read on the Postmaster docs that you can use postmaster for this purpose, but I have been unable to find any more info, or documentation other than to say it can be done.

3

You need to create a new "Hook" entry in Postmaster that uses the send_system_email hook. Then use {hook:from_name}, {hook:from_email}, {hook:subject}, {hook:message}, etc in the various fields when creating the parcel (all the variables listed here.)

It's not explained very clearly, I know. I had a bit of an exchange over Twitter with Justin about it, and he said he was planning on clarifying how to do this in the docs.

8
  • OK, I think that makes sense! So I take it I would need to create a new hook entry for each email I wish to override? (You're right, it's not too clear!) – shorn Apr 5 '13 at 19:37
  • Nope, not for each email - just once! It will apply to all emails generated using EE's email class. That's why you use the {hook:foo} variables - they will be populated with the appropriate info for each email the system sends. – Derek Hogue Apr 5 '13 at 21:21
  • Ok, let's see. Say for example I've created my (HTML/css) email template. In the body, I just add {hook:message} and that will pull in the body of the message that's in the native ee templates right? – shorn Apr 5 '13 at 21:35
  • Correct. (I should note that Justin from Objective HTML does offer pretty good support for his add-ons if you want to get in touch with him directly.) – Derek Hogue Apr 5 '13 at 22:04
  • OK, think I get it now, although if I can only pull in the message, I wouldn't be able to customise the actual message would I? For example, if within the message, I wanted a sentence in bold. Or could I just add the html tags to the native message templates, and that would be pulled in? – shorn Apr 5 '13 at 22:21
0

They can be found in the control panel: Design > Message Pages > Email Notifications.

If you want to save these speciality templates as files though I'd highly recommend Libraree. It will save not only speciality templates but also email templates, global variables and snippets as files to be run through version control. They can also be parsed as regular template files meaning more control and the ability to include any other tags for greater customisation.

5
  • What are the downvotes for on both answers? The are both genuine workable solutions from people who are trying to help. – Ian Apr 5 '13 at 18:56
  • Please see the why's and when's about downvoting: stackoverflow.com/privileges/vote-down – Ian Apr 5 '13 at 19:39
  • Not sure, I haven't voted at all. I will try and attempt this with Postmaster, but will look at this if I cannot get it to work. – shorn Apr 5 '13 at 19:40
  • Sorry shorn, I didn't mean you. I think I know who the serial downvoter is but why is the mystery. Give Dereks' suggestion a try. Never done that before myself but it may do what you need. I always look to Libraree as it saves so much time in the long run when dealing with multiple speciality templates. I also prefer to have them saved as template files like regular templates. – Ian Apr 5 '13 at 20:26
  • No probs, looks like I might be on the right track with Postmaster. Thanks for assistance. – shorn Apr 5 '13 at 22:29
0

You need to add the mailtype in the email sending code. Like for the email template of "Member Account Activation Instructions", go around line number 690 of file "/expressionengine/modules/member/mod.member_register.php" and put this line of code

$this->EE->email->mailtype = 'html';

after

$this->EE->load->library('email');

Same can be applied for other emails which are not having mailtype as 'html'.

0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.