<?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 sending email using custom code workflow action on developer account in APIs &amp; Integrations</title>
    <link>https://community.hubspot.com/t5/APIs-Integrations/sending-email-using-custom-code-workflow-action-on-developer/m-p/982439#M73922</link>
    <description>&lt;P&gt;I am trying to send an email using a custom code action in a workflow, because I want to add a cc to the email. The request seems correct, but I get a forbidden message. I am on a developer account and I am not really sure if the developer account supports doing this or is my code incorrect?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="javascript"&gt;  const emailData = {
    emailId: 104023995106,
    message: {
      to: "myemail@gmail.com",
    },
    contactProperties: {},
    customProperties: {}
  }

  const response = await hsClient.apiRequest({
      method: 'POST',
      path: '/marketing/v3/transactional/single-email/send',
      body: emailData,
      headers: {
        'Content-Type': 'application/json'
      },
      defaultJson: true
  });&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;response:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="javascript"&gt;{
  size: 0,
  timeout: 0,
  [Symbol(Body internals)]: {
    body: Gunzip {
      _writeState: [Uint32Array],
      _events: [Object],
      _readableState: [ReadableState],
      _writableState: [WritableState],
      allowHalfOpen: true,
      _maxListeners: undefined,
      _eventsCount: 5,
      bytesWritten: 0,
      _handle: [Zlib],
      _outBuffer: &amp;lt;Buffer bb 28 00 00 00 49 bc 40 da 28 af 09 56 00 00 41 ff 95 50 4c 00 00 50 50 4c 8b 45 f8 49 8b 40 2f 49 3b 85 98 01 00 00 0f 85 24 00 00 00 48 8b 75 f8 49 ... 16334 more bytes&amp;gt;,
      _outOffset: 0,
      _chunkSize: 16384,
      _defaultFlushFlag: 2,
      _finishFlushFlag: 2,
      _defaultFullFlushFlag: 3,
      _info: undefined,
      _maxOutputLength: 4294967296,
      _level: -1,
      _strategy: 0,
      [Symbol(shapeMode)]: true,
      [Symbol(kCapture)]: false,
      [Symbol(kCallback)]: null,
      [Symbol(kError)]: null
    },
    disturbed: false,
    error: null
  },
  [Symbol(Response internals)]: {
    url: 'https://api.hubapi.com/marketing/v3/transactional/single-email/send',
    status: 403,
    statusText: 'Forbidden',
    headers: Headers { [Symbol(map)]: [Object: null prototype] },
    counter: 0
  }
}&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks in advance!&lt;/P&gt;</description>
    <pubDate>Mon, 27 May 2024 05:45:23 GMT</pubDate>
    <dc:creator>Yannick_Lange</dc:creator>
    <dc:date>2024-05-27T05:45:23Z</dc:date>
    <item>
      <title>sending email using custom code workflow action on developer account</title>
      <link>https://community.hubspot.com/t5/APIs-Integrations/sending-email-using-custom-code-workflow-action-on-developer/m-p/982439#M73922</link>
      <description>&lt;P&gt;I am trying to send an email using a custom code action in a workflow, because I want to add a cc to the email. The request seems correct, but I get a forbidden message. I am on a developer account and I am not really sure if the developer account supports doing this or is my code incorrect?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="javascript"&gt;  const emailData = {
    emailId: 104023995106,
    message: {
      to: "myemail@gmail.com",
    },
    contactProperties: {},
    customProperties: {}
  }

  const response = await hsClient.apiRequest({
      method: 'POST',
      path: '/marketing/v3/transactional/single-email/send',
      body: emailData,
      headers: {
        'Content-Type': 'application/json'
      },
      defaultJson: true
  });&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;response:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="javascript"&gt;{
  size: 0,
  timeout: 0,
  [Symbol(Body internals)]: {
    body: Gunzip {
      _writeState: [Uint32Array],
      _events: [Object],
      _readableState: [ReadableState],
      _writableState: [WritableState],
      allowHalfOpen: true,
      _maxListeners: undefined,
      _eventsCount: 5,
      bytesWritten: 0,
      _handle: [Zlib],
      _outBuffer: &amp;lt;Buffer bb 28 00 00 00 49 bc 40 da 28 af 09 56 00 00 41 ff 95 50 4c 00 00 50 50 4c 8b 45 f8 49 8b 40 2f 49 3b 85 98 01 00 00 0f 85 24 00 00 00 48 8b 75 f8 49 ... 16334 more bytes&amp;gt;,
      _outOffset: 0,
      _chunkSize: 16384,
      _defaultFlushFlag: 2,
      _finishFlushFlag: 2,
      _defaultFullFlushFlag: 3,
      _info: undefined,
      _maxOutputLength: 4294967296,
      _level: -1,
      _strategy: 0,
      [Symbol(shapeMode)]: true,
      [Symbol(kCapture)]: false,
      [Symbol(kCallback)]: null,
      [Symbol(kError)]: null
    },
    disturbed: false,
    error: null
  },
  [Symbol(Response internals)]: {
    url: 'https://api.hubapi.com/marketing/v3/transactional/single-email/send',
    status: 403,
    statusText: 'Forbidden',
    headers: Headers { [Symbol(map)]: [Object: null prototype] },
    counter: 0
  }
}&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks in advance!&lt;/P&gt;</description>
      <pubDate>Mon, 27 May 2024 05:45:23 GMT</pubDate>
      <guid>https://community.hubspot.com/t5/APIs-Integrations/sending-email-using-custom-code-workflow-action-on-developer/m-p/982439#M73922</guid>
      <dc:creator>Yannick_Lange</dc:creator>
      <dc:date>2024-05-27T05:45:23Z</dc:date>
    </item>
    <item>
      <title>Re: sending email using custom code workflow action on developer account</title>
      <link>https://community.hubspot.com/t5/APIs-Integrations/sending-email-using-custom-code-workflow-action-on-developer/m-p/982662#M73938</link>
      <description>&lt;P&gt;Hi &lt;SPAN style="background: var(--ck-color-mention-background); color: var(--ck-color-mention-text);"&gt;&lt;a href="https://community.hubspot.com/t5/user/viewprofilepage/user-id/767910"&gt;@Yannick_Lange&lt;/a&gt;&lt;/SPAN&gt;,&lt;BR /&gt;&lt;BR /&gt;Thank you for asking the Community!&lt;BR /&gt;&lt;BR /&gt;I'd like to put you in touch with some of our Top Experts and Community Members: Hi &lt;SPAN style="background: var(--ck-color-mention-background); color: var(--ck-color-mention-text);"&gt;&lt;a href="https://community.hubspot.com/t5/user/viewprofilepage/user-id/264909"&gt;@ChrisChiha&lt;/a&gt;&lt;/SPAN&gt;, &lt;SPAN style="background: var(--ck-color-mention-background); color: var(--ck-color-mention-text);"&gt;&lt;a href="https://community.hubspot.com/t5/user/viewprofilepage/user-id/240077"&gt;@ABeian&lt;/a&gt;&lt;/SPAN&gt;, &lt;SPAN style="background: var(--ck-color-mention-background); color: var(--ck-color-mention-text);"&gt;&lt;a href="https://community.hubspot.com/t5/user/viewprofilepage/user-id/93098"&gt;@JenBergren&lt;/a&gt;&lt;/SPAN&gt; and &lt;SPAN style="background: var(--ck-color-mention-background); color: var(--ck-color-mention-text);"&gt;&lt;a href="https://community.hubspot.com/t5/user/viewprofilepage/user-id/174708"&gt;@jgranados&lt;/a&gt;&lt;/SPAN&gt; do you have suggestions to help &lt;SPAN style="background: var(--ck-color-mention-background); color: var(--ck-color-mention-text);"&gt;&lt;a href="https://community.hubspot.com/t5/user/viewprofilepage/user-id/767910"&gt;@Yannick_Lange&lt;/a&gt;&lt;/SPAN&gt;, please?&lt;BR /&gt;&lt;BR /&gt;Thank you so much and have a lovely day!&lt;BR /&gt;&lt;BR /&gt;Best,&lt;BR /&gt;Bérangère&lt;/P&gt;</description>
      <pubDate>Mon, 27 May 2024 14:36:16 GMT</pubDate>
      <guid>https://community.hubspot.com/t5/APIs-Integrations/sending-email-using-custom-code-workflow-action-on-developer/m-p/982662#M73938</guid>
      <dc:creator>BérangèreL</dc:creator>
      <dc:date>2024-05-27T14:36:16Z</dc:date>
    </item>
    <item>
      <title>Re: sending email using custom code workflow action on developer account</title>
      <link>https://community.hubspot.com/t5/APIs-Integrations/sending-email-using-custom-code-workflow-action-on-developer/m-p/982750#M73949</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://community.hubspot.com/t5/user/viewprofilepage/user-id/767910"&gt;@Yannick_Lange&lt;/a&gt;&amp;nbsp;,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;The 403 error indicates that there is something wrong with the authorization. That can either mean that your authorization token is expired, has the incorrect scope or that your current account has no access to the transactional email add-on.&lt;/P&gt;
&lt;P&gt;Based on the &lt;A href="https://developers.hubspot.com/docs/api/marketing/transactional-emails#send-your-email-using-the-single-send-api" target="_blank" rel="noopener"&gt;docs&lt;/A&gt;, it should be possible to add a CC to the single-send API. You can add it to the message object in your example.&lt;/P&gt;</description>
      <pubDate>Mon, 27 May 2024 18:29:49 GMT</pubDate>
      <guid>https://community.hubspot.com/t5/APIs-Integrations/sending-email-using-custom-code-workflow-action-on-developer/m-p/982750#M73949</guid>
      <dc:creator>Teun</dc:creator>
      <dc:date>2024-05-27T18:29:49Z</dc:date>
    </item>
    <item>
      <title>Re: sending email using custom code workflow action on developer account</title>
      <link>https://community.hubspot.com/t5/APIs-Integrations/sending-email-using-custom-code-workflow-action-on-developer/m-p/982965#M73963</link>
      <description>&lt;P&gt;Hello,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I don't have first hand experience with this exact case, so please take my message with a grain of salt!&lt;BR /&gt;&lt;BR /&gt;If the code itself has no faults, then the exact account(s) setup might be the issue.&lt;BR /&gt;Based on &lt;A href="https://developers.hubspot.com/docs/api/account-types" target="_blank" rel="noopener"&gt;the documentation about the different HubSpot account types&lt;/A&gt;, it seems that:&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;&lt;P&gt;(1) Any app (a custom code bit) that you build inside a "Developer Account" can then be deployed in either a "Standard Account" or a "Developer TEST Account"&lt;BR /&gt;&lt;BR /&gt;(2) If you wish to deploy your custom code as a workflow action in a "Standard Account", then you need to be sure the &lt;A href="https://knowledge.hubspot.com/marketing-email/how-to-use-transactional-email-in-hubspot" target="_blank" rel="noopener"&gt;transactional email add-on&lt;/A&gt;&amp;nbsp;is enabled&lt;BR /&gt;&amp;nbsp; &amp;nbsp;* this setup should allow you to test the custom code on any given Contact entry that has an email address&lt;BR /&gt;&lt;BR /&gt;(3) You can opt to instead test your custom code in a "Developer TEST Account", but &lt;A href="https://developers.hubspot.com/changelog/new-limits-on-developer-test-accounts-starting-12/19/2022" target="_blank" rel="noopener"&gt;there are some limitations&lt;/A&gt; such as needing to ask support to enabled the add-on and also only being able to target email addressed that are added as users into that account&lt;BR /&gt;&lt;BR /&gt;Hope this will help at least a little bit!&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;</description>
      <pubDate>Tue, 28 May 2024 08:50:38 GMT</pubDate>
      <guid>https://community.hubspot.com/t5/APIs-Integrations/sending-email-using-custom-code-workflow-action-on-developer/m-p/982965#M73963</guid>
      <dc:creator>ABeian</dc:creator>
      <dc:date>2024-05-28T08:50:38Z</dc:date>
    </item>
  </channel>
</rss>

