-
-
Notifications
You must be signed in to change notification settings - Fork 3k
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
feat(medusa-plugin-sendgrid): Add error messages #4384
Conversation
🦋 Changeset detectedLatest commit: fb133ac The changes in this PR will be included in the next version bump. This PR includes changesets to release 1 package
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 |
@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") |
There was a problem hiding this comment.
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?
There was a problem hiding this comment.
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}`
There was a problem hiding this comment.
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 👍
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
lgtm!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
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.