Answers.Body: <p>It sounds like you would want to create a custom token. See <a href="https://docs.civicrm.org/dev/en/latest/hooks/hook_civicrm_tokens/" rel="nofollow noreferrer">https://docs.civicrm.org/dev/en/latest/hooks/hook_civicrm_tokens/</a></p>
  <p>So for the value of the token you would need to do the Swish api call and then use the result.</p>
  
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2021-01-18T17:06:07.173Z
Answers.Text: Thanks, I will look into the function, unknown to me at preset, but it looks exciting! I will post back when I've tried.
  Claes
Answers.UserDisplayName: Claes Rickeby
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2021-01-17T16:32:15.130Z
Answers.LastActivityDate: 2021-01-17T16:32:15.130Z
Answers.UserDisplayName: Demerit
Body: <p>I wish to include a personalised QR-code in the Mass Mail for people in the Grace list, to facilitate their payment, which in Sweden can be done by the Swish function: use your phone, read/scan the QR code, key in your PIN, and the payment is done.</p>
  <p>The problem I meet is to understand how I can invoke the result (a unique personalised QR png-file) of an API-request (to the Swish company) in the flow of text in the mass-mail message.</p>
  <p>Has anybody done this before? Can php be invoked or Python?</p>
  <p>Claes</p>
  
Tags: <civimail>
Title: QR code inclusion in Mass-mailings
ThreadText: # QR code inclusion in Mass-mailings
  
  (Asked by: username_0 on 2021-01-17)
  
  I wish to include a personalised QR-code in the Mass Mail for people in the Grace list, to facilitate their payment, which in Sweden can be done by the Swish function: use your phone, read/scan the QR code, key in your PIN, and the payment is done.
  
  The problem I meet is to understand how I can invoke the result (a unique personalised QR png-file) of an API-request (to the Swish company) in the flow of text in the mass-mail message.
  
  Has anybody done this before? Can php be invoked or Python?
  
  username_0
  
  **Tags:** civimail
  
  
  ---
  
  ## 1 answers
  
  ### Answer by username_1 on 2021-01-17. Score: 4
  
  It sounds like you would want to create a custom token. See <https://docs.civicrm.org/dev/en/latest/hooks/hook_civicrm_tokens/>
  
  So for the value of the token you would need to do the Swish api call and then use the result.
  
  > **Comments:**
  > **username_0**: Thanks, I will look into the function, unknown to me at preset, but it looks exciting! I will post back when I've tried. username_0  
  
  ---
  
  