Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Is it possible to leave blank 'Cc' and 'Bcc'? #263

Closed
ronakvbhatt07 opened this issue Aug 2, 2016 · 3 comments
Closed

Is it possible to leave blank 'Cc' and 'Bcc'? #263

ronakvbhatt07 opened this issue Aug 2, 2016 · 3 comments
Labels
type: question question directed at the library

Comments

@ronakvbhatt07
Copy link

ronakvbhatt07 commented Aug 2, 2016

I am working on a sending mail option where i am using Code of sending mail Without mail helper class. Now the thing is i am binding to,cc and bcc dynamically. There might be possibilities that need to pass blank cc and bcc as well. So in that case what should i do to prevent generating error?

request.body = {
  "personalizations": [
    {
      "to": [
       {
          "email": "test@example.com"
        }
      ],
      "cc":[],
      "bcc":[]
      "subject": "Hello World from the SendGrid Node.js Library!"
    }
  ],
  "from": {
    "email": "test@example.com"
  },
  "content": [
   {
      "type": "text/plain",
      "value": "Hello, Email!"
   }
 ]
};
@thinkingserious thinkingserious added the type: question question directed at the library label Aug 2, 2016
@thinkingserious
Copy link
Contributor

@ronakvbhatt07,

When they are empty, you can leave out the cc and bcc objects:

request.body = {
  "personalizations": [
    {
      "to": [
       {
          "email": "test@example.com"
        }
      ],
      "subject": "Hello World from the SendGrid Node.js Library!"
    }
  ],
  "from": {
    "email": "test@example.com"
  },
  "content": [
   {
      "type": "text/plain",
      "value": "Hello, Email!"
   }
 ]
};

e.g.: http://stackoverflow.com/a/5310331

@ronakvbhatt07
Copy link
Author

@thinkingserious thank you mate. Yes tried the same thing. And its working. 🎯

@thinkingserious
Copy link
Contributor

Awesome! Thanks for the follow up!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type: question question directed at the library
Projects
None yet
Development

No branches or pull requests

2 participants