Skip to content

Document how to obtain htmlContent or PlainText of what was sent / will be sent when using dynamic templates #1025

@hbermani

Description

@hbermani

Issue Summary (Question)

I love SendGrid but I am really hitting a brick wall here. I imagine it's a common scenario in applications to want to show an audit trail / email correspondence history once an email is sent via SendGrid. I use dynamic templates to send emails and I am finding that I have one of two options:

  • Use the API to obtain htmlcontent of the dynamic template and replace variables manually - this will have limitations as each template will have different variables.
  • Use Inbound Parse and try and figure out where the email belongs in a multitenant distributed application and then store it from there. One issue with this is the URL for the API Post endpoint will need to be accessible on the Web so it will not be possible to test this on local host.

Both options feel very long winded, is there an alternative simpler approach? For example...

  • Query an API endpoint with x-message-id to obtain copy of the email body.
  • SendEmailAsync() response to contain htmlContent and PlainText
  • TemplateEngine Endpoint where we can post variables and template Id and it will generate htmlContext and plaintext back?

I really welcome your thoughts and suggestions

Steps to Reproduce

  1. SendEmailAsync() then try and access the content of what was sent.

Exception/Log

None

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions