# Issue with variables in emails

**URL:** <https://community.hubspot.com/t/issue-with-variables-in-emails/108766>\
**Category:** Email Marketing Tool\
**Tags:** marketing-email\
**Created:** [June 6, 2024, 2:28am UTC](https://community.hubspot.com/t/issue-with-variables-in-emails/108766 "2024-06-06T02:28:25Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![mnorman](https://avatars.discourse-cdn.com/v4/letter/m/87869e/32.png) [@mnorman](https://community.hubspot.com/u/mnorman)\
**Post date:** [June 6, 2024, 2:28am UTC](https://community.hubspot.com/t/issue-with-variables-in-emails/108766/1 "2024-06-06T02:28:25Z")

</div>

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)

 ![hubspot-capture.png](https://d2qpr2jzcazej7.cloudfront.net/original/3X/0/e/0e6511bc030c8d07a3f052437bf13fc5d7b9026f.png)

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.

---

<div class="post-metadata">

**Author:** ![PamCotton](https://d10pqhm3lwygmk.cloudfront.net/user_avatar/community.hubspot.com/pamcotton/32/47916_2.png) [@PamCotton](https://community.hubspot.com/u/PamCotton)\
**Post date:** [June 6, 2024, 6:27pm UTC](https://community.hubspot.com/t/issue-with-variables-in-emails/108766/2 "2024-06-06T18:27:37Z")

</div>

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

###
