Issue with variables in emails

PROBLEM: all of our RSS emails are outputting the wrong date.

The date output has been working for months until this week. Now all of a sudden starting on Sunday (we don’t send emails on Saturdays), the date that is passed is always “060124”. But I’ll lay out all of the pieces and maybe someone has a thought

RSS Feed

Our RSS feed puts in an ad block with the following reference

kw=cb_{{ send_date|format_datetime('MMddyy', local_time_zone) }}

send_date is obviously not a HUBL variable, but something we define in the HubSpot template…

HubSpot Template

Currently our template sets a variable called “send_date”:

{% set send_date = content.publish_date %}

We originally did this because the reference in the RSS feed wasn’t working when we tried content.publish_date (my assumption was a scope issue).

I wanted to rule something else out, so I tried setting the send_date to today’s date.

{% set send_date = datetime.date.today() %}

This just drove home for me that something might be amiss with the email system. When I output this directly to the HTML, in the editor and preview, I’m seeing today’s date (“060524”). I then sent myself the preview and incredibly, it is still showing “060124”. Now I know it’s not tied to the scope of the “send_date” in the RSS feed.

(screenshot, first circled date is in the email, the second is in the preview)

So we’ve got the preview outputting the date as expected, but the generated email is incorrect. I don’t understand why, and again, this was working fine last week.

Anyone dealing with a similar issue or know if any changes were made that might result in this?

UPDATE from the next morning: I’m now not able to replicate the date discrepancy between the email send and the preview window. This leads me to believe I must have done something wrong in my testing. However, the RSS referenced date is still showing 6/1, which now leads me back to my original thinking that this is a scope issue.

Hey @mnorman, thank you for posting in our Community!

I would recommend that first, ensure that send_date is being set correctly in your HubSpot template. You mentioned you tried setting it to today’s date directly:

{% set send_date = datetime.date.today() %} Ensure this line is correct and not overwritten later in the template.

If the email system or template is caching the date, it could be using an outdated value. Try clearing the cache or refreshing the template.

To our experts, @TomM2 and @Anton do you have any recommendations for the @mnorman matter?

Thank you,

Pam