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...

demandé il y a 3 mois135 vues
2 réponses
0
Réponse acceptée

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
INGÉNIEUR EN ASSISTANCE TECHNIQUE
Mukul_V
répondu il y a 3 mois
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.

répondu il y a 3 mois

Vous n'êtes pas connecté. Se connecter pour publier une réponse.

Une bonne réponse répond clairement à la question, contient des commentaires constructifs et encourage le développement professionnel de la personne qui pose la question.

Instructions pour répondre aux questions