Sendgrid-nodejs: The click_tracking enable parameter is not supported

Created on 16 Dec 2017  路  7Comments  路  Source: sendgrid/sendgrid-nodejs

Issue Summary

The API does not support the click_tracking enable parameter. Or rather, using it (setting it to a boolean value) results in an API error.

https://sendgrid.api-docs.io/v3.0/mail-send/v3-mail-send

{\"errors\":[{\"message\":\"The click_tracking enable parameter is required.\",\"field\":\"tracking_settings.click_tracking.enable\",\"help\":\"http://sendgrid.com/docs/API_Reference/Web_API_v3/Mail/errors.html#message.tracking_settings.click_tracking.enable\"}]}

Steps to Reproduce

Make an HTTP request to the /v3/mail/send endpoint with the following payload.

const params = {
  content: [
    {
      type: 'text/html',
      value: '<p>Test Email</p>',
    },
  ],
  from: {
    email: '[email protected]',
    name: 'Example Site',
  },
  subject: 'EMAIL SUBJECT HERE', 
  tracking_settings: {
    // For some reason you can't actually use this:
    // Results in error: "The click_tracking enable parameter is required."
    // click_tracking: {
    //   enabled: true, // or false,
    // },
  },
}

Technical details:

  • sendgrid-nodejs Version: master (latest commit: [commit number]) (^5.2.3)
  • Node.js Version: 8.5.0
help wanted bug

Most helpful comment

Yes, it was due to using the wrong word form. Thanks for your help.

tracking_settings.click_tracking.enabled
vs
tracking_settings.click_tracking.enable

All 7 comments

Hi @Xeoncross,

Thanks for bringing this to our attention. I've added this to our backlog for further investigation.

Do you mind sharing the request body?

With Best Regards,

Elmer

I didn't use the sgMail.send(msg) or @sendgrid/helpers. I used the HTTP JSON web v3.0 api (/v3/mail/send).

    const Sendgrid = require('sendgrid');
    const client = Sendgrid(apiKey);

    const request = client.emptyRequest({
      method: 'POST',
      path: '/v3/mail/send',
      body: params
    });

    client.API(request, (e, response) => { ...});

Hi @Xeoncross,

What is the value of params?

Also, I recommend using this package as it should make things much easier for you.

With Best Regards,

Elmer

The value of params is shown in the ticket issue (the API params). I need to use the full API so there is currently no reason for me to switch to @sendgrid/mail. The V3 Rest API is working fine for my sends apart from this one param.

Got it, I'll take a deeper look.

I think the issue may be related to how you are formatting the body. Please take a look at this example.

Yes, it was due to using the wrong word form. Thanks for your help.

tracking_settings.click_tracking.enabled
vs
tracking_settings.click_tracking.enable
Was this page helpful?
0 / 5 - 0 ratings

Related issues

nicoasp picture nicoasp  路  3Comments

egges picture egges  路  3Comments

TobiahRex picture TobiahRex  路  3Comments

danielflippance picture danielflippance  路  4Comments

agostonbonomi picture agostonbonomi  路  3Comments