THIS THREAD HAS BEEN CLOSED.

[Tut] How to edit header email and footer email

Updated on Sep 2, 2016 in FreelanceEngine
3 on Jul 18, 2016

This tutorial to helps you can customize the header email and footer email .

Add this code into child-theme/functions.php file

 

add_filter( 'ae_get_mail_header', 'cs_custom_header_email' );
function cs_custom_header_email(){
 
$logo_url = get_template_directory_uri() . "/img/logo-de.png";
$options = AE_Options::get_instance();
 
// save this setting to theme options
$site_logo = $options->site_logo;
if (!empty($site_logo)) {
$logo_url = $site_logo['large'][0];
}
 
$logo_url = apply_filters('ae_mail_logo_url', $logo_url);
$customize = et_get_customization();
$mail_header = '<html>
<head>
</head>
<body style="font-family: Arial, sans-serif;font-size: 0.9em;margin: 0; padding: 0; color: #222222;">
<div style="margin: 0px auto; width:600px; border: 1px solid ' . $customize['background'] . '">
<table width="100%" cellspacing="0" cellpadding="0">
<tr style="background: ' . $customize['header'] . '; height: 63px; vertical-align: middle;">
<td style="padding: 10px 5px 10px 20px; width: 20%;">
<img style="max-height: 100px" src="' . $logo_url . '" alt="' . get_option('blogname') . '">
</td>
<td style="padding: 10px 20px 10px 5px">
<span style="text-shadow: 0 0 1px #151515; color: #b0b0b0;">' . get_option('blogdescription') . '</span>
</td>
</tr>
<tr><td colspan="2" style="height: 5px; background-color: ' . $customize['background'] . ';"></td></tr>
<tr>
<td colspan="2" style="background: #ffffff; color: #222222; line-height: 18px; padding: 10px 20px;">';
return $mail_header;
}

That is the html of header email You can modify and edit it to edit the header email.

Similar for footer email. Copy this code into child-theme/functions.php file and modify this code to edit the header email

 

add_filter( 'ae_get_mail_footer', 'cs_custom_mail_footer' );
function cs_custom_mail_footer() {
 
$info = apply_filters('ae_mail_footer_contact_info', get_option('blogname') . ' <br> ' . get_option('admin_email') . ' <br>');
$customize = et_get_customization();
$copyright = apply_filters('get_copyright', ae_get_option('copyright'));
$mail_footer = '</td>
</tr>
<tr>
<td colspan="2" style="background: ' . $customize['background'] . '; padding: 10px 20px; color: #666;">
<table width="100%" cellspacing="0" cellpadding="0">
<tr>
<td style="vertical-align: top; text-align: left; width: 50%;">' . $copyright . '</td>
<td style="text-align: right; width: 50%;">' . $info . '</td>
</tr>
</table>
</td>
</tr>
</table>
</div>
</body>
</html>';
return $mail_footer;
}

 

 

  • Liked by
0 on Aug 19, 2016

This is an example to remove the default header and footer.

Use the above hook and make the header is empty.

code:

 

add_filter( 'ae_get_mail_header', 'cs_custom_header_email' );
function cs_custom_header_email(){
$header_hml = '';
return $header_hml ;
}
add_filter( 'ae_get_mail_footer', 'cs_custom_mail_footer' );
function cs_custom_mail_footer(){
$footer_html= '';
return $footer_html;
}

 

  • Liked by
Cancel
0 on Aug 19, 2016

How to change the logo default in header email :

have 2 ways we can do for this issue;

1)Edit code directly in the method : cs_custom_header_email above and change the line 14

from

$logo_url = apply_filters(‘ae_mail_logo_url’, $logo_url);

to

$logo_url = 'http://forum.enginethemes.com/wp-content/uploads/2016/08/logo-sample.png';

2) Add this code into child-theme/functions.php file to change the logo in header email

add_filter('ae_mail_logo_url','cs_custom_email_logo');
 function cs_custom_email_logo(){
 $logo_url = 'http://forum.enginethemes.com/wp-content/uploads/2016/08/logo-sample.png';
 return $logo_url;
 }

 

  • Liked by
Cancel
0 on Sep 2, 2016

How to change ad blog name(Copy right).

1)In the ae_get_mail_footer hook above, we edit the value of variable $coppyright(line 40).

2) Or Add this php code into child-theme/functions.php file

add_filter( 'get_copyright', 'cs_custom_blog_name_in_email');
function cs_custom_blog_name_in_email(){
return ' This is blog name';
}
  • Liked by
Cancel
Loading more replies
Posting & Replying function will be deactivated from 3pm GMT+7 12th Sep.
Read More