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

feat(medusa-plugin-sendgrid): Add error messages #4384

Merged

Conversation

pevey
Copy link
Contributor

@pevey pevey commented Jun 21, 2023

This PR adds a few error messages in the sendNotification method of the SendgridService to assist with troubleshooting and configuration. Several users have reported "sendgrid is not sending notifications." This PR will help those users provide more useful information when reporting issues.

@pevey pevey requested a review from a team as a code owner June 21, 2023 16:27
@changeset-bot
Copy link

changeset-bot bot commented Jun 21, 2023

🦋 Changeset detected

Latest commit: fb133ac

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 1 package
Name Type
medusa-plugin-sendgrid Patch

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

@vercel
Copy link

vercel bot commented Jun 21, 2023

@pevey is attempting to deploy a commit to the medusajs Team on Vercel.

A member of the Team first needs to authorize it.

@@ -221,10 +222,14 @@ class SendGridService extends NotificationService {
let templateId = this.getTemplateId(event)

if (!templateId) {
return false
throw new MedusaError(MedusaError.Types.INVALID_DATA, "Sendgrid service: No template was set for this event")
Copy link
Contributor

@olivermrbl olivermrbl Jun 22, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

thought(non-blocking): Should we also log the event name?

Copy link
Contributor Author

@pevey pevey Jun 22, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Does that string get interpolated? Can I do:

`Sendgrid service: No template was set for event: ${event}`

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yes you can do that 👍

@olivermrbl olivermrbl changed the title add error messages to SendgridService.sendNotification feat(medusa-plugin-sendgrid): Add error messages Jun 26, 2023
Copy link
Contributor

@olivermrbl olivermrbl left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lgtm!

Copy link
Member

@adrien2p adrien2p left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@olivermrbl olivermrbl merged commit f65a501 into medusajs:develop Jun 26, 2023
@github-actions github-actions bot mentioned this pull request Jun 26, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants