Advertisement:

Author Topic: Skin for email templates!  (Read 965 times)

BritWeb

  • Hero Member
  • *****
  • Posts: 770
  • If it ain't broke, don't fix it.
Skin for email templates!
« on: March 16, 2015, 11:20:38 pm »
Hi folks

Is there a way we can apply a skin for all the email templates and have the possibility of editing it whenever needed in one go instead of doing it for every template.

I have done a skin for a template and tested it. Please, see the pic attached.

Thanks
« Last Edit: March 16, 2015, 11:36:30 pm by BritWeb »

teseo

  • Hero Member
  • *****
  • Posts: 6169
Re: Skin for email templates!
« Reply #1 on: March 16, 2015, 11:59:33 pm »
Hi,

Customized header and footer for all your emails:

1.- Create two new pages named "email_general_header" and "email_general_footer". The title won't be used for this, but is required, so put anything there. Build your element with the available tools on RichEdit, then uncheck "Show a link in footer" and Save.

2.- Now add this at the very bottom of your theme functions.php (take care not to leave blank lines after this):

Code: [Select]
<?php
function cust_email_customization($mail$params) { 

    
$locale osc_current_user_locale();

    
$mPages = new Page() ;
    
$custom_header $mPages->findByInternalName('email_general_header') ;
    
$custom_footer $mPages->findByInternalName('email_general_footer') ;

    
$mail->Body $custom_header['locale'][$locale]['s_text'] . $mail->Body $custom_footer['locale'][$locale]['s_text'];

    return 
$mail;
}

osc_add_filter('pre_send_mail''cust_email_customization');
?>


That's all, regards

BritWeb

  • Hero Member
  • *****
  • Posts: 770
  • If it ain't broke, don't fix it.
Re: Skin for email templates!
« Reply #2 on: March 17, 2015, 12:24:59 am »
Hey teseo

You are a star. This is exactly what I was looking for.

Thanks a million!