Suggestions for creating Email Notification Service

I am thinking of creating a separate worker process with its own queue name to handle email notifications for our application.

The question/suggestions I’d like is in terms of performance/history/parameter size.

I have two options I can think of when sending the content of the emails:

  1. Have Service A generate the content of the email in a JSON request (to, from, subject, content, etc) and could also use a template engine to format the content and then send it to the task queue via an Activity method sendEmailNotification(EmailNotificationRequest request) to be picked up by the remote worker.

  2. Have Notification Service maintain all the possible “email templates” to accomplish the particular notification (Order Accepter, Order Failed, etc) and only send the bare minimum in the payload.

The issue I am wondering is if I go with #1 will I have to worry about attachements? and payload size when sending to the queue? I thought I saw something about 2 MB for method payloads in Activities?

Granted, in my current use case, the content size will be controlled by our application and not be very large.

I thought about adding the sending of the notification into my Api gateway which kicks off the workflow, but that seems the incorrect place.

Thoughts?

I would model this in a way that makes more sense from the business logic point of view. If you need to pass large payloads, use some other store (like S3) and pass references to the objects through workflow and activity inputs and outputs.