Sendgrid-nodejs: sendAt issues

Created on 20 May 2015  Â·  10Comments  Â·  Source: sendgrid/sendgrid-nodejs

I'm trying to set the SMTPAPI header using the sendAt() function. The sendgrid.send() callback returns no errors, and the JSON returned has message: success, but in my email activity, it says Invalid SMTPAPI header.

question

All 10 comments

I've logged the headers here:

2015-05-20T15:01:29.152Z - info: Header: {
    "version": "1.1.0",
    "header": {
        "to": [
            "[email protected]",
            "[email protected]"
        ],
        "sub": {
            "%unsubscribe_link%": [
                "https://<redacted>",
                "https://<redacted>"
            ]
        },
        "unique_args": {},
        "category": [],
        "section": {},
        "filters": {},
        "send_at": 1432134300000,
        "send_each_at": [],
        "asm_group_id": {}
    }
}

I was sending milliseconds, not seconds. I have to say, just the smallest bit of documentation around the sendAt() method could have helped.

Appologies for the confusion and glad you were able to sort it out. I'll see about getting the docs spiffed up a bit.

Hi Richard, I just posted an new issue with send_at. My send_at doesn't work and you will be very very nice if you could help me with that.. :( Thank you very much

+1 on clarifying the documentation to be explicit about 'seconds' vs milliseconds.
Been bashing my head against the wall for a few hours wondering why my scheduled time of 3 minutes in advance (for testing purposes) kept throwing up an error 400 - 'Scheduling more than 72 hours in advance is forbidden'

Pages that a couple of edits will go a long way in helping:

  1. https://sendgrid.com/docs/API_Reference/SMTP_API/scheduling_parameters.html
  2. https://sendgrid.com/docs/API_Reference/Web_API_v3/Mail/index.html

Cheers to OP for the thread that eventually let me figure this out!

@HemalR,

I'm happy to make the updates to our documentation, but I'm not quite sure I understand the issue. The send_at field requires a unix timestamp given in seconds, as shown in the example. Could you give me an example of what the updated documentation would look like?

Thanks @thinkingserious

I guess it's because I'm beginner to the point of not recognising that the example digit was in seconds (what I had learned about Unix timestamps is that they are in ms). If I had to, I would simply put in: '(in seconds)' in the documentation. Like this:

docs

That said, I recognise this may be an extremely silly suggestion and very obvious to most devs more experienced than me (this experience in itself has made it so that I am unlikely to ever make the same mistake again).

Cheers anyway!

Thanks for the suggestion @HemalR!

Our docs are open source, would you like to make a PR? Otherwise, I'll go ahead and make the PR.

I'll do the pull request. Never done one before (hence my procrastination)-
but it'll be a good learning experience.

I'll do it now.

Cheers
On Sat., 29 Oct. 2016 at 12:07 am, Elmer Thomas [email protected]
wrote:

Thanks for the suggestion @HemalR https://github.com/HemalR!

Our docs are open source, would you like to make a PR? Otherwise, I'll go
ahead and make the PR.

—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
https://github.com/sendgrid/sendgrid-nodejs/issues/166#issuecomment-256961075,
or mute the thread
https://github.com/notifications/unsubscribe-auth/AO6Pf3akRbXG5CTe8wEzIQNm8z0PplvYks5q4h2wgaJpZM4Eh6E5
.

Awesome, thanks!

https://www.sendgrid.com
Elmer Thomas
Developer Experience Engineer | Product

On Wed, Nov 2, 2016 at 8:28 PM, Hemal [email protected] wrote:

I'll do the pull request. Never done one before (hence my procrastination)-
but it'll be a good learning experience.

I'll do it now.

Cheers
On Sat., 29 Oct. 2016 at 12:07 am, Elmer Thomas [email protected]
wrote:

Thanks for the suggestion @HemalR https://github.com/HemalR!

Our docs are open source, would you like to make a PR? Otherwise, I'll go
ahead and make the PR.

—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
issuecomment-256961075>,
or mute the thread
AO6Pf3akRbXG5CTe8wEzIQNm8z0PplvYks5q4h2wgaJpZM4Eh6E5>
.

—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
https://github.com/sendgrid/sendgrid-nodejs/issues/166#issuecomment-258057820,
or mute the thread
https://github.com/notifications/unsubscribe-auth/AAI9B8yBge-2gRp-B77rzzSR4DxbHWm5ks5q6VT5gaJpZM4Eh6E5
.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

prasoonjalan picture prasoonjalan  Â·  3Comments

metalshan picture metalshan  Â·  3Comments

mikemaccana picture mikemaccana  Â·  4Comments

wooyah picture wooyah  Â·  4Comments

umarhussain15 picture umarhussain15  Â·  3Comments