Why is Pinpoint email not accepting "Context" attributes?

0

Problem Pinpoint is not working per documentation.

Background

  1. I'm issuing a SendMessagesCommand via the Javascript SDK v3
    • I'm specifying a Template
    • I'm providing a Context object (i.e., k/v pairs)
    • The Template has one single attribute that is supposed to be substituted {{tripId}}
  2. When the Template has a "Default Value" set for {{tripId}}, the command is successful and an email arrives, but with the default value.
  3. When the Template's "Default Value" is empty, the command is successful but no email arrives.

So... I'm stuck with two outcomes:

  1. "SUCCESSFUL" send and an email that gets delivered with the wrong value (the default); or
  2. "SUCCESSFUL" send and no email delivered

Obviously, neither work. I would troubleshoot this further, but I'm not even sure how (?). This feels like some sort of internal Pinpoint error or unclear documentation...

asked 3 months ago122 views
2 Answers
0
Accepted Answer

Hi,

Thank you for sharing your observations in detail. I would like to mention that I am able to replicate the behaviour shared by you. Further, I am also able to move past this behaviour after using Substitutions instead of Context either under Addresses or Endpoints in the SendMessages API call.

I used the following command at my end :-

aws pinpoint send-messages --application-id <application-id> --message-request file://file.json

The contents of file.json is mentioned below :-

{
    "Addresses": {
        "<email>": {
            "ChannelType": "EMAIL",
            "Substitutions": {
                "tripId": ["1223445"]
            }
        }
    },
    "MessageConfiguration": {
        "EmailMessage": {
            "FromAddress": "<from-address>"
        }
    },
    "TemplateConfiguration": {
        "EmailTemplate": {
          "Name": "tesst",
          "Version": "1"
        }
    }
}

In case of any follow up queries, please reach out to us via creating a support case with us.

AWS
SUPPORT ENGINEER
Mukul_V
answered 3 months ago
0

Yes, I was able to make this discovery as well.

I wish AWS would update the Pinpoint documentation to more clearly define when to use Context vs. Substitutions, since they are very similar as to how to use them.

answered 3 months ago

You are not logged in. Log in to post an answer.

A good answer clearly answers the question and provides constructive feedback and encourages professional growth in the question asker.

Guidelines for Answering Questions