{date} not working - E-Newsletter Plugin

I made some tweaks to one of the newsletter templates and added the {date} option to the template but it's not showing up, it is just showing "F j, Y". Am I missing something?

  • Vaughan

    Hi Jason,

    Hope you're well?

    Could you grant support access from the dashboard plugin so we can take a closer look? See https://premium.wpmudev.org/manuals/wpmu-dev-dashboard-enabling-staff-login/

    Would it also be possible to send me a copy of your custom template so I can take a look?

    If so, can you send it to contact[at]wpmudev.org

    Mark in the subject line: Attention of Vaughan
    Please also include a URL to this thread so I know what thread the email is referring to.

    Thanks

  • Vaughan

    Hi Jason,

    After investigating this, we can see the issue & I have reported this as a bug to the developer.

    In the meantime you can fix this by editing the plugin.

    /wp-content/plugins/e-newsletter/e-newsletter-files/class-functions.php

    Find the following code on lines 1213 - 1231

    //Prepare newsletter body
            $body_prepare =
            array(
                'standard' => array(
                    'header' => $contents_parts['default_style_header'].$contents_parts['style_header'],
                    'content_header' => '',
                    'footer' => '',
                    'content_footer' => '',
                    'content=email_body' => $newsletter_data['content'],
                    'title=email_title' => $this->get_newsletter_meta($newsletter_id,'email_title', $this->get_default_builder_var('email_title') ),
                    'subject=email_subject' => $newsletter_data['subject'],
                    'from_name' => (isset($newsletter_data['from_name']) ? $newsletter_data['from_name'] : $this->settings['from_name']),
                    'from_email' => (isset($newsletter_data['from_email']) ? $newsletter_data['from_email'] : $this->settings['from_email']),
                    'branding_html' => $this->get_newsletter_meta($newsletter_id,'branding_html', $this->get_default_builder_var('branding_html') ),
                    'contact_info' => (isset($newsletter_data['contact_info']) ? $newsletter_data['contact_info'] : $this->settings['contact_info']),
                    'date' => (isset($this->settings['date_format']) ? $this->settings['date_format'] : "F j, Y"),
                    'view_link_text' => $settings['view_browser']
                )
            );

    Replace with:

    //Prepare newsletter body
            $date_format = (isset($this->settings['date_format']) ? $this->settings['date_format'] : "F j, Y");
            $body_prepare =
            array(
                'standard' => array(
                    'header' => $contents_parts['default_style_header'].$contents_parts['style_header'],
                    'content_header' => '',
                    'footer' => '',
                    'content_footer' => '',
                    'content=email_body' => $newsletter_data['content'],
                    'title=email_title' => $this->get_newsletter_meta($newsletter_id,'email_title', $this->get_default_builder_var('email_title') ),
                    'subject=email_subject' => $newsletter_data['subject'],
                    'from_name' => (isset($newsletter_data['from_name']) ? $newsletter_data['from_name'] : $this->settings['from_name']),
                    'from_email' => (isset($newsletter_data['from_email']) ? $newsletter_data['from_email'] : $this->settings['from_email']),
                    'branding_html' => $this->get_newsletter_meta($newsletter_id,'branding_html', $this->get_default_builder_var('branding_html') ),
                    'contact_info' => (isset($newsletter_data['contact_info']) ? $newsletter_data['contact_info'] : $this->settings['contact_info']),
                    'date' => date_i18n( $date_format, date() ),
                    'view_link_text' => $settings['view_browser']
                )
            );

    Hope this helps

Thank NAME, for their help.

Let NAME know exactly why they deserved these points.

Gift a custom amount of points.