Answers.Body: <p>If these emails are associated to a status change (for example from &quot;Processing&quot; to &quot;Complete&quot;) you can use <a href="https://craftcms.com/docs/commerce/3.x/order-status-emails.html" rel="nofollow noreferrer">order status emails</a>. For something more complex you will have to write a custom plugin that listens for  EVENT_ORDER_STATUS_CHANGE (or a more appropriate one, according to your case) and then reacts accordingly.</p>
  
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2021-08-03T12:20:45.797Z
Answers.LastActivityDate: 2021-08-03T12:20:45.797Z
Answers.UserDisplayName: gioppe
Body: <p>I have created a module that processes certain order statuses. I have two PDF attachments I need to attach to these orders. These orders are processed after payment gateway authorization so I'm wondering if there is a way to trigger the order email with these two PDF's programmatically.</p>
  <p>Thanks in advance.</p>
  
Tags: <plugin-craftcommerce>
Title: Trigger Order Emails Programatically
ThreadText: # Trigger Order Emails Programatically
  
  (Asked by: username_0 on 2021-07-02)
  
  I have created a module that processes certain order statuses. I have two PDF attachments I need to attach to these orders. These orders are processed after payment gateway authorization so I'm wondering if there is a way to trigger the order email with these two PDF's programmatically.
  
  Thanks in advance.
  
  **Tags:** plugin-craftcommerce
  
  
  ---
  
  ## 1 answers
  
  ### Answer by username_1 on 2021-08-03. Score: 1
  
  If these emails are associated to a status change (for example from "Processing" to "Complete") you can use [order status emails](https://craftcms.com/docs/commerce/3.x/order-status-emails.html). For something more complex you will have to write a custom plugin that listens for EVENT\_ORDER\_STATUS\_CHANGE (or a more appropriate one, according to your case) and then reacts accordingly.
  
  
  ---
  
  