The effects of alcohol on sustanon 250 leucine for – real weight loss & bodybuilding benefits?
HTML Emails not dis...
 
Share:
Notifications
Clear all

Issue HTML Emails not displaying correctly

6 Posts
2 Users
0 Reactions
312 Views
Posts: 3
Topic starter
(@webmeda-org)
Active Member
Joined: 3 weeks ago

Wordpress is adding line breaks to my HTML code for my emails. I tried to follow online tutorials to remove the filter through functions php:

Can anyone help? Or explain why it's not working?

 

add_action('wpdiscuz_email_before_send_email', 'wpd_remove_wpautop_from_emails', 1);

function wpd_remove_wpautop_from_emails($args) {
    if ( isset($args['wpdiscuz_email_content']) ) {
        $args['wpdiscuz_email_content'] = str_replace(array('<p>', '</p>'), '', $args['wpdiscuz_email_content']);
        $args['wpdiscuz_email_content'] = str_replace(array('<br>', '<br />'), '', $args['wpdiscuz_email_content']);
    }
    return $args;
}
 

Topic Tags
5 Replies
Asti
Posts: 8181
 Asti
Support
(@asti)
Illustrious Member
Joined: 8 years ago

Hi, @webmeda-org,

Please try this code: 

add_filter('wpdiscuz_confirm_email_content_pre_replace', 'wpd_remove_wpautop_from_emails', 1);

function wpd_remove_wpautop_from_emails($message) {
    if ($message) {
        $message = str_replace(['<p>', '</p>'], '', $message);
        $message = str_replace(['<br>', '<br />'], '', $message);
    }
    return $message;
}

Reply
Posts: 3
Topic starter
(@webmeda-org)
Active Member
Joined: 3 weeks ago

Reply
1 Reply
Asti
 Asti
Support
(@asti)
Joined: 8 years ago

Illustrious Member
Posts: 8181

@webmeda-org 

Your post appears to be empty. Could you please confirm whether the issue has been resolved?


Reply
Posts: 3
Topic starter
(@webmeda-org)
Active Member
Joined: 3 weeks ago

I was trying to show you the code before and after saving and I think that's breaking my comment, I tried to attach them as files but that's also not allowed


Reply
1 Reply
Asti
 Asti
Support
(@asti)
Joined: 8 years ago

Illustrious Member
Posts: 8181

@webmeda-org 

Please record a video, so we can see the problem. 


Reply
Share: