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

fix: require in TS at least 1 type of content for sending mail #1041

Merged
merged 1 commit into from
Feb 21, 2020

Conversation

childish-sambino
Copy link
Contributor

Fixes #978

@thinkingserious thinkingserious added the status: code review request requesting a community code review or review from Twilio label Feb 14, 2020
@childish-sambino childish-sambino merged commit ce5707a into master Feb 21, 2020
@thinkingserious
Copy link
Contributor

Hello @childish-sambino,

Thanks again for the PR!

We appreciate your contribution and look forward to continued collaboration. Thanks!

Team SendGrid DX

@JClackett
Copy link

This has introduced a TS error when sending mails with just templateIds:

const data = {
	from: "someemail",
    to: "somemail",
    templateId: "some sendgrid templateId",
    dynamic_template_data: {randonVariables: "something"},
}

sendgrid.send(data)
Property 'content' is missing in type '{ from: string; to: string | string[]; templateId: string; dynamic_template_data: any; }' but required in type '{ content: MailContent[] & { 0: MailContent; }; }'.

We dont require there to be a body or content as its using a template?

Any ideas?

@childish-sambino
Copy link
Contributor Author

🤦‍♂ Need more |s.

@krazibit
Copy link

krazibit commented Mar 9, 2020

as @JClackett mentioned, template use case was not included.
anyone working to add the type union in the MailDataRequired already?

@childish-sambino
Copy link
Contributor Author

@krazibit It was included as part of #1053

@krazibit
Copy link

krazibit commented Mar 9, 2020

great, thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
status: code review request requesting a community code review or review from Twilio
Projects
None yet
Development

Successfully merging this pull request may close these issues.

TypeScript types allow mails with missing bodies
5 participants