<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: Event calendar in email with upcoming events in CMS Development</title>
    <link>https://community.hubspot.com/t5/CMS-Development/Event-calendar-in-email-with-upcoming-events/m-p/751623#M32706</link>
    <description>&lt;P&gt;Hi,&amp;nbsp;&lt;a href="https://community.hubspot.com/t5/user/viewprofilepage/user-id/434224"&gt;@PKemps&lt;/a&gt;&amp;nbsp;&lt;span class="lia-unicode-emoji" title=":waving_hand:"&gt;👋&lt;/span&gt; Thanks for sharing your question. Hey,&amp;nbsp;&lt;a href="https://community.hubspot.com/t5/user/viewprofilepage/user-id/17186"&gt;@Anton&lt;/a&gt;&amp;nbsp;&lt;a href="https://community.hubspot.com/t5/user/viewprofilepage/user-id/153634"&gt;@tominal&lt;/a&gt;&amp;nbsp;&lt;a href="https://community.hubspot.com/t5/user/viewprofilepage/user-id/193060"&gt;@JBeatty&lt;/a&gt;&amp;nbsp;have you dared to navigate down this particular road for email templates?&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Thanks for taking a look! — Jaycee&lt;/P&gt;</description>
    <pubDate>Sat, 04 Feb 2023 01:05:58 GMT</pubDate>
    <dc:creator>Jaycee_Lewis</dc:creator>
    <dc:date>2023-02-04T01:05:58Z</dc:date>
    <item>
      <title>Event calendar in email with upcoming events</title>
      <link>https://community.hubspot.com/t5/CMS-Development/Event-calendar-in-email-with-upcoming-events/m-p/751381#M32700</link>
      <description>&lt;P&gt;Hi, i hope that someone can help me.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I'm creating a event calendar module to be used in email with the next 3 upcoming events. I created some custom properties for that and a custom emailmodule. But now i trying to filter only the upcoming events.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;This piece of code filters the 3 marketing events and that works:&lt;/P&gt;&lt;P&gt;{% set events = crm_objects("marketing_event", "limit=3&amp;amp;orderBy=event_start_date") %}&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I want to add a filter to the "set" for the upcoming events like: &amp;amp;unixtimestamp(local_dt) &amp;lt; event.event_start_date.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I cannot get this to work. So i pprint some data:&lt;/P&gt;&lt;UL&gt;&lt;LI&gt;event_start_date: (String: 26-10-22)&lt;/LI&gt;&lt;LI&gt;unixtimestamp(event.event_start_date.value): (Long: 1675423920776)&lt;/LI&gt;&lt;LI&gt;local_dt: (PyishDate: 2023-02-03 12:32:00)&lt;/LI&gt;&lt;LI&gt;unixtimestamp(local_dt): (Long: 1675423920663)&lt;/LI&gt;&lt;LI&gt;local_dt|format_date('dd-MM-yy'): (String: 03-02-23)&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;It looks that the&amp;nbsp;unixtimestamp(event.event_end_date.value) creates a current timestamp instead that of the value of event_end_date of 26-10-2022.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I hope that someone can help.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 03 Feb 2023 16:42:11 GMT</pubDate>
      <guid>https://community.hubspot.com/t5/CMS-Development/Event-calendar-in-email-with-upcoming-events/m-p/751381#M32700</guid>
      <dc:creator>PKemps</dc:creator>
      <dc:date>2023-02-03T16:42:11Z</dc:date>
    </item>
    <item>
      <title>Re: Event calendar in email with upcoming events</title>
      <link>https://community.hubspot.com/t5/CMS-Development/Event-calendar-in-email-with-upcoming-events/m-p/751623#M32706</link>
      <description>&lt;P&gt;Hi,&amp;nbsp;&lt;a href="https://community.hubspot.com/t5/user/viewprofilepage/user-id/434224"&gt;@PKemps&lt;/a&gt;&amp;nbsp;&lt;span class="lia-unicode-emoji" title=":waving_hand:"&gt;👋&lt;/span&gt; Thanks for sharing your question. Hey,&amp;nbsp;&lt;a href="https://community.hubspot.com/t5/user/viewprofilepage/user-id/17186"&gt;@Anton&lt;/a&gt;&amp;nbsp;&lt;a href="https://community.hubspot.com/t5/user/viewprofilepage/user-id/153634"&gt;@tominal&lt;/a&gt;&amp;nbsp;&lt;a href="https://community.hubspot.com/t5/user/viewprofilepage/user-id/193060"&gt;@JBeatty&lt;/a&gt;&amp;nbsp;have you dared to navigate down this particular road for email templates?&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Thanks for taking a look! — Jaycee&lt;/P&gt;</description>
      <pubDate>Sat, 04 Feb 2023 01:05:58 GMT</pubDate>
      <guid>https://community.hubspot.com/t5/CMS-Development/Event-calendar-in-email-with-upcoming-events/m-p/751623#M32706</guid>
      <dc:creator>Jaycee_Lewis</dc:creator>
      <dc:date>2023-02-04T01:05:58Z</dc:date>
    </item>
    <item>
      <title>Re: Event calendar in email with upcoming events</title>
      <link>https://community.hubspot.com/t5/CMS-Development/Event-calendar-in-email-with-upcoming-events/m-p/751655#M32708</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://community.hubspot.com/t5/user/viewprofilepage/user-id/434224"&gt;@PKemps&lt;/a&gt;&amp;nbsp;- You might need to use&amp;nbsp;&lt;SPAN&gt;&lt;STRONG&gt;unixtimestamp(event.event_start_date)&lt;/STRONG&gt; not&amp;nbsp;unixtimestamp(event.event_start_date.value). The&amp;nbsp;unixtimestamp() will return current timestamp when it can't convert the datetime object.&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Sat, 04 Feb 2023 05:19:28 GMT</pubDate>
      <guid>https://community.hubspot.com/t5/CMS-Development/Event-calendar-in-email-with-upcoming-events/m-p/751655#M32708</guid>
      <dc:creator>Cereno-Deng</dc:creator>
      <dc:date>2023-02-04T05:19:28Z</dc:date>
    </item>
    <item>
      <title>Re: Event calendar in email with upcoming events</title>
      <link>https://community.hubspot.com/t5/CMS-Development/Event-calendar-in-email-with-upcoming-events/m-p/751970#M32712</link>
      <description>&lt;P&gt;When i use&amp;nbsp;&lt;STRONG&gt;unixtimestamp(event.event_start_date) &lt;/STRONG&gt;pprint prints nothing.&lt;/P&gt;</description>
      <pubDate>Mon, 06 Feb 2023 08:02:09 GMT</pubDate>
      <guid>https://community.hubspot.com/t5/CMS-Development/Event-calendar-in-email-with-upcoming-events/m-p/751970#M32712</guid>
      <dc:creator>PKemps</dc:creator>
      <dc:date>2023-02-06T08:02:09Z</dc:date>
    </item>
    <item>
      <title>Re: Event calendar in email with upcoming events</title>
      <link>https://community.hubspot.com/t5/CMS-Development/Event-calendar-in-email-with-upcoming-events/m-p/755215#M32801</link>
      <description>&lt;P&gt;Your even.event_start_date is datetime or string type? It must be datetime type to make&amp;nbsp;unixtimestamp work.&lt;/P&gt;</description>
      <pubDate>Sun, 12 Feb 2023 21:12:36 GMT</pubDate>
      <guid>https://community.hubspot.com/t5/CMS-Development/Event-calendar-in-email-with-upcoming-events/m-p/755215#M32801</guid>
      <dc:creator>Cereno-Deng</dc:creator>
      <dc:date>2023-02-12T21:12:36Z</dc:date>
    </item>
    <item>
      <title>Re: Event calendar in email with upcoming events</title>
      <link>https://community.hubspot.com/t5/CMS-Development/Event-calendar-in-email-with-upcoming-events/m-p/755423#M32810</link>
      <description>&lt;P&gt;Thanks for your respons. It is a date picker property. But the&amp;nbsp;&lt;SPAN&gt;unixtimestamp(&lt;STRONG&gt;event.event_start_date.value&lt;/STRONG&gt;) pprint current date and not the right date value of the property and&amp;nbsp;&lt;STRONG&gt;unixtimestamp(event.event_start_date)&amp;nbsp;&lt;/STRONG&gt;pprint prints nothing.&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Mon, 13 Feb 2023 12:24:25 GMT</pubDate>
      <guid>https://community.hubspot.com/t5/CMS-Development/Event-calendar-in-email-with-upcoming-events/m-p/755423#M32810</guid>
      <dc:creator>PKemps</dc:creator>
      <dc:date>2023-02-13T12:24:25Z</dc:date>
    </item>
    <item>
      <title>Re: Event calendar in email with upcoming events</title>
      <link>https://community.hubspot.com/t5/CMS-Development/Event-calendar-in-email-with-upcoming-events/m-p/755855#M32830</link>
      <description>&lt;P&gt;I created a test environment like yours and get the same issue.&amp;nbsp; The problem is no correct way to convert the string to datetime pbject. The &lt;A href="https://developers.hubspot.com/docs/cms/hubl/filters#strtotime" target="_blank" rel="noopener"&gt;strtotime&lt;/A&gt; filter only convert string like&amp;nbsp;"yyyy-MM-dd'T'HH:mm:ssZ".&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;For example,&amp;nbsp; the&amp;nbsp;{{ "26-10-22"|strtotime("dd-MM-yyyy") }} will get error "Error in `Marketplace/HubSpot/HTML/Custom Module/HTML.module/module.html` on line 3: com.hubspot.jinjava.interpret.InterpretException: stringToTime() could not match datetime input 26-10-22 with datetime format dd-MM-yyyy" shown in the browser&amp;nbsp;DevTools. Many people also get this issue like &lt;A href="https://community.hubspot.com/t5/CMS-Development/Looking-for-wisdom-on-usage-of-quot-strtotime-quot-filter/m-p/263615" target="_blank" rel="noopener"&gt;this discussion&lt;/A&gt;.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;So I think the better way is to convert custom object to HubDB table. I am sure the column with date type can be converted to timestamp normally by unixtimestamp(). You can &lt;A href="https://github.com/cerenodeng/object2db" target="_blank" rel="noopener"&gt;see this&lt;/A&gt; to know how to convert/sync custom object with HubDB table.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 14 Feb 2023 09:01:39 GMT</pubDate>
      <guid>https://community.hubspot.com/t5/CMS-Development/Event-calendar-in-email-with-upcoming-events/m-p/755855#M32830</guid>
      <dc:creator>Cereno-Deng</dc:creator>
      <dc:date>2023-02-14T09:01:39Z</dc:date>
    </item>
    <item>
      <title>Re: Event calendar in email with upcoming events</title>
      <link>https://community.hubspot.com/t5/CMS-Development/Event-calendar-in-email-with-upcoming-events/m-p/755888#M32832</link>
      <description>&lt;P&gt;Hi Cereno-Deng, we only have marketing Pro, so i have no options for HubDB and programmable actions in workflows. But thanks that you looked into it.&lt;/P&gt;</description>
      <pubDate>Tue, 14 Feb 2023 10:26:00 GMT</pubDate>
      <guid>https://community.hubspot.com/t5/CMS-Development/Event-calendar-in-email-with-upcoming-events/m-p/755888#M32832</guid>
      <dc:creator>PKemps</dc:creator>
      <dc:date>2023-02-14T10:26:00Z</dc:date>
    </item>
    <item>
      <title>Re: Event calendar in email with upcoming events</title>
      <link>https://community.hubspot.com/t5/CMS-Development/Event-calendar-in-email-with-upcoming-events/m-p/756383#M32854</link>
      <description>&lt;P&gt;Hi Paul,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I have an idea. You can change the &lt;SPAN&gt;event_start_date type to string, &lt;/SPAN&gt;create a admin page for &lt;SPAN&gt;marketing_event custom object&amp;nbsp;&lt;/SPAN&gt;to call the backend APIs on your server to create/update them. In the backend API, you can convert start date to the correct format&amp;nbsp;strtotime filter can accept, and call the &lt;A href="https://developers.hubspot.com/docs/api/crm/crm-custom-objects" target="_blank" rel="noopener"&gt;CRM API for custom objects&lt;/A&gt;. So it should work on your calendar module: {% set start_date = &lt;SPAN&gt;unixtimestamp(&lt;/SPAN&gt;&lt;SPAN&gt;event.event_start_date&lt;/SPAN&gt;|strtotime("yyyy-MM-dd'T'HH:mm:ssZ")) %}&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Cereno&lt;/P&gt;</description>
      <pubDate>Fri, 17 Feb 2023 02:09:29 GMT</pubDate>
      <guid>https://community.hubspot.com/t5/CMS-Development/Event-calendar-in-email-with-upcoming-events/m-p/756383#M32854</guid>
      <dc:creator>Cereno-Deng</dc:creator>
      <dc:date>2023-02-17T02:09:29Z</dc:date>
    </item>
    <item>
      <title>Re: Event calendar in email with upcoming events</title>
      <link>https://community.hubspot.com/t5/CMS-Development/Event-calendar-in-email-with-upcoming-events/m-p/757216#M32885</link>
      <description>&lt;P&gt;Hi Cereno-Deng, i'm not so familiar with api. I will ask our IT-department if they can help me. Thanks.&lt;/P&gt;</description>
      <pubDate>Thu, 16 Feb 2023 13:33:25 GMT</pubDate>
      <guid>https://community.hubspot.com/t5/CMS-Development/Event-calendar-in-email-with-upcoming-events/m-p/757216#M32885</guid>
      <dc:creator>PKemps</dc:creator>
      <dc:date>2023-02-16T13:33:25Z</dc:date>
    </item>
    <item>
      <title>Re: Event calendar in email with upcoming events</title>
      <link>https://community.hubspot.com/t5/CMS-Development/Event-calendar-in-email-with-upcoming-events/m-p/771096#M33397</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://community.hubspot.com/t5/user/viewprofilepage/user-id/434224"&gt;@PKemps&lt;/a&gt;,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Like we discussed, here is the solution to the question &lt;span class="lia-unicode-emoji" title=":winking_face_with_tongue:"&gt;😜&lt;/span&gt;;&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;{% set current_date = unixtimestamp(local_dt) %}
{% set query = "limit=3&amp;amp;orderBy=custom_end_date&amp;amp;custom_end_date__gte="~current_date %} 
{% set events = crm_objects("marketing_event", query, "hs_event_name,custom_end_date", false) %}

{% for item in events.results %}
  &amp;lt;p&amp;gt;
   {{item.hs_event_name}}
  &amp;lt;/p&amp;gt;
{% endfor %}
&lt;/LI-CODE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 20 Mar 2023 14:02:59 GMT</pubDate>
      <guid>https://community.hubspot.com/t5/CMS-Development/Event-calendar-in-email-with-upcoming-events/m-p/771096#M33397</guid>
      <dc:creator>Teun</dc:creator>
      <dc:date>2023-03-20T14:02:59Z</dc:date>
    </item>
  </channel>
</rss>

