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

misleading label in Notification form #213

Open
viktor-c opened this issue Apr 24, 2023 · 1 comment
Open

misleading label in Notification form #213

viktor-c opened this issue Apr 24, 2023 · 1 comment

Comments

@viktor-c
Copy link

What's this issue about?

When using notifications I get a Hint stating "You can also use MJML</u> to create your email templates"

Expected behavior

I expect to type a string as a body and see it in the received email

Actual behavior

"context":"SubmissionSetFieldService","submission":6,"form":2,"error":{"name":"Error","message":"Parsing failed. Check your mjml.","stack":"Error: Parsing failed. Check your mjml.\n    at MJMLParser (/usr/src/api/node_modules/mjml-parser-xml/lib/index.js:340:11)\n    at mjml2html (/usr/src/api/node_modules/mjml-core/lib/index.js:224:39)\n    at /usr/src/api/dist/service/submission/submission.notification.service.js:39:49\n    at Array.map (<anonymous>)\n    at SubmissionNotificationService.process (/usr/src/api/dist/service/submission/submission.notification.service.js:30:57)\n    at SubmissionSetFieldService.finishSubmission (/usr/src/api/dist/service/submission/submission.set.field.service.js:78:28)\n    at async SubmissionFinishMutation.submissionFinish (/usr/src/api/dist/resolver/submission/submission.finish.mutation.js:32:9)\n    at async target (/usr/src/api/node_modules/@nestjs/core/helpers/external-context-creator.js:77:28)\n    at async Object.submissionFinish (/usr/src/api/node_modules/@nestjs/core/helpers/external-proxy.js:9:24)"},"msg":"failed to send notifications"}

When a mjml template is used I get 2 identical notifications. When notifications are not setup, I get no notification at all.

Steps to reproduce

Install the latest ohmyform docker image, then setup a form and enable notifications.

Environment

Ubuntu 20.04, latest ohmyform docker image.

@viktor-c
Copy link
Author

The hint is misleading, the code is also not robust enough.
When notifications are sent, there is no logging for it; when an error occurs I get some logging.

Logging for sent email does occur
context":"MailService","email":"****@example.com","template":"user/created","language":"en","msg":"sent email"}
But no logging on sending submissions.

I think this occurs because
user.create.service.ts uses import { MailService } from '../mail.service'
but
submission.notification.service.ts uses import { MailerService } from '@nestjs-modules/mailer'

So emails are sent in 2 inconsistent ways throughout the code.

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

No branches or pull requests

1 participant