Skip to content

Email bundle and refactoring #47

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

Conversation

maxceem
Copy link
Contributor

@maxceem maxceem commented May 14, 2018

Issues: #37 #38 #40 and appirio-tech/connect-app#1991

Note:

@maxceem maxceem changed the base branch from dev to feature/email-settings May 14, 2018 08:20
@gondzo
Copy link
Collaborator

gondzo commented May 17, 2018

Looks good.
@vikasrohit - we need to make some changes to the email service too as it won't support loops in the email template, see this comment #40 (comment)

Before deploying this one, you need to manually execute this script on the notifications database https://github.com/maxceem/tc-notifications/blob/5e1700ec7e294f22517e89445db2137485dd02ca/migrations/v2.0.sql

then just merge this PR and the one in connect-app repo. There are no new environment variables

@vikasrohit
Copy link

@gondzo I think we have to build the HTML in tc-notifications instead of letting email service doing this for us because email service should not know how to unroll the list of objects into HTML. As suggested in the post, we can created a variable in template e.g. {{notificationsHTML}} and send the prepared HTML for this variable in our bundled event payload along with the list of notifications. For now we won't use the actual notifications in templates, but once we get support from Sendgrid, we can prepare a template with looping. They have it in beta so may be can try it out, in parallel, with a different version of the same email template.

@gondzo
Copy link
Collaborator

gondzo commented May 18, 2018

OK, then you can create a new template in sendgrid with notificationsHTML parameter and I'll add the change to prepare the html in notifications service.

@vikasrohit
Copy link

@gondzo I have created a new template in Sendgrid for the event type 'notifications.action.email.connect.project.bundled' which just contain {{notificationsHTML}} as variable to replace. It is deployed in dev and you should be able to send emails now with this event. Let me know if you see any errors.

@gondzo gondzo merged commit b2a2f19 into topcoder-platform:feature/email-settings May 20, 2018
@gondzo
Copy link
Collaborator

gondzo commented May 20, 2018

@vikasrohit I have added the changes to prepare html for bundled events, but pushing the event to bus api returns an error Check your token scope.. Any ideas which scope do we need to call bus-api service? And in general, do we have a mapping of required scopes for various services?

@vikasrohit
Copy link

@gondzo I think there are some changes going on for machine to machine tokens for new auth upgrade. I guess, we need to merge our changes into dev to get those changes reflected on our changes. I am merging the PR after invoking the migration sql on dev instance. Lets hope it works after that.

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