saleor / apps

A central space for Saleor Apps, integrations, and the App Store 🚀
https://apps.saleor.io
Other
114 stars 314 forks source link

QA: Emails & Messages App testing #266

Open lkostrowski opened 1 year ago

lkostrowski commented 1 year ago

App installation:

Channels configuration:

MJML

MJML Configuration tab:

MJML Event editing view:

MJML Emails delivery:

To test if the emails are sent, I recommend using the https://mailtrap.io/ and fill SMTP details in the MJML configuration.

Sendgrid

Configuration tab

Event configuration tab

Installation manifest URLs

https://emails-and-messages.saleor.app/api/manifest https://emails-and-messages.staging.saleor.app/api/manifest

lkostrowski commented 1 year ago

@krzysztofwolski please prepare some basic user stories / scenarios, so QA can pick this up and run some tests before its released in Appstore

cc @michalina-graczyk

szczecha commented 1 year ago

Validation errors appear only for a second

App version staging 1.1.0

  1. Install the app
  2. Go to the MJML tab and create a new configuration
  3. Save the empty form Result: Only general error is shown After recording, I see that there are error messages under the input but they disappear too quickly

https://user-images.githubusercontent.com/30683248/226940535-c597b914-b72d-4757-aa9e-b69f41261b17.mov

szczecha commented 1 year ago

Email is sent when MJML config is not active

App version staging 1.1.0

Config: Request URL: https://emails-and-messages.staging.saleor.app/api/trpc/appConfiguration.getChannelConfiguration?batch=1&input=%7B%220%22%3A%7B%22channelSlug%22%3A%22default-channel%22%7D%7D {result: {data: {active: true,

Request URL: https://emails-and-messages.staging.saleor.app/api/trpc/mjmlConfiguration.getConfigurations?batch=1&input=%7B%7D

[
    {
        "result": {
            "data": [
                {
                    "id": "1679494839016",
                    "active": false,
                    "configurationName": "MailTrap",
                    "senderName": "SaleorSender",
                    "senderEmail": "sender@example.com",
                    "smtpHost": "sandbox.smtp.mailtrap.io",
                    "smtpPort": "2525",
                    "smtpUser": "***",
                    "smtpPassword": "***",
                    "encryption": "TLS",
                    "events": [
                        {
                            "active": true,
                            "eventType": "ORDER_CREATED",
                            "template": "\n<mjml>\n  <mj-body>\n    <mj-section>\n      <mj-column>\n        <mj-text font-size=\"16px\">\n          Hello!\n        </mj-text>\n        <mj-text>\n          Order {{ order.number }} has been created.\n        </mj-text>\n      </mj-column>\n    </mj-section>\n    \n    <mj-section>\n      <mj-column>\n        <mj-table>\n          <thead>\n            <tr>\n              <th>\n                Billing address\n              </th>\n              <th>\n                Shipping address\n              </th>\n            </tr>\n          </thead>\n          <tbody>\n            <tr>\n              <td>\n                {{#if order.billingAddress}}\n                  {{ order.billingAddress.streetAddress1 }}\n                {{else}}\n                  No billing address\n                {{/if}}\n              </td>\n              <td>\n                {{#if order.shippingAddress}}\n                  {{ order.shippingAddress.streetAddress1}}\n                {{else}}\n                  No shipping required\n                {{/if}}\n              </td>\n            </tr>\n          </tbody>\n        </mj-table>\n      </mj-column>\n    </mj-section>\n\n    \n  <mj-section>\n    <mj-column>\n      <mj-table>\n        <tbody>\n          {{#each order.lines }}\n            <tr>\n              <td style=\"width:66px\">\n                <img height=\"66\" src=\"{{this.thumbnail.url}}\" style=\"border:0;display:block;outline:none;text-decoration:none;height:66px;width:100%;font-size:13px;\" width=\"66\">\n              </td>\n              <td>\n                {{ this.quantity }} x {{ this.productName }} - {{ this.variantName }}\n              </td>\n              <td align=\"right\">\n                {{ this.totalPrice.gross.amount }} {{ this.totalPrice.gross.currency }}\n              </td>\n            </tr>\n          {{/each}}\n          <tr>\n            <td>\n            </td>\n            <td align=\"right\">\n              Shipping: {{ order.shippingPrice.gross.amount }} {{ order.shippingPrice.gross.currency }}\n            </td>\n          </tr>\n          <tr>\n            <td>\n            </td>\n            <td align=\"right\">\n              Total: {{ order.total.gross.amount }} {{ order.total.gross.currency }}\n            </td>\n          </tr>\n        </tbody>\n      </mj-table>\n    </mj-column>\n  </mj-section>\n\n  </mj-body>\n</mjml>",
                            "subject": "Order {{ order.number }} has been created as"
                        },
                        {
                            "active": false,
                            "eventType": "ORDER_FULFILLED",
                            "template": "\n<mjml>\n  <mj-body>\n    <mj-section>\n      <mj-column>\n        <mj-text font-size=\"16px\">\n          Hello!\n        </mj-text>\n        <mj-text>\n          Order {{ order.number}} has been fulfilled.\n        </mj-text>\n      </mj-column>\n    </mj-section>\n    \n    <mj-section>\n      <mj-column>\n        <mj-table>\n          <thead>\n            <tr>\n              <th>\n                Billing address\n              </th>\n              <th>\n                Shipping address\n              </th>\n            </tr>\n          </thead>\n          <tbody>\n            <tr>\n              <td>\n                {{#if order.billingAddress}}\n                  {{ order.billingAddress.streetAddress1 }}\n                {{else}}\n                  No billing address\n                {{/if}}\n              </td>\n              <td>\n                {{#if order.shippingAddress}}\n                  {{ order.shippingAddress.streetAddress1}}\n                {{else}}\n                  No shipping required\n                {{/if}}\n              </td>\n            </tr>\n          </tbody>\n        </mj-table>\n      </mj-column>\n    </mj-section>\n\n    \n  <mj-section>\n    <mj-column>\n      <mj-table>\n        <tbody>\n          {{#each order.lines }}\n            <tr>\n              <td>\n                {{ this.quantity }} x {{ this.productName }} - {{ this.variantName }}\n              </td>\n              <td align=\"right\">\n                {{ this.totalPrice.gross.amount }} {{ this.totalPrice.gross.currency }}\n              </td>\n            </tr>\n          {{/each}}\n          <tr>\n            <td>\n            </td>\n            <td align=\"right\">\n              Shipping: {{ order.shippingPrice.gross.amount }} {{ order.shippingPrice.gross.currency }}\n            </td>\n          </tr>\n          <tr>\n            <td>\n            </td>\n            <td align=\"right\">\n              Total: {{ order.total.gross.amount }} {{ order.total.gross.currency }}\n            </td>\n          </tr>\n        </tbody>\n      </mj-table>\n    </mj-column>\n  </mj-section>\n\n  </mj-body>\n</mjml>",
                            "subject": "Order {{ order.number }} has been fulfilled"
                        },
                        {
                            "active": false,
                            "eventType": "ORDER_CONFIRMED",
                            "template": "\n<mjml>\n  <mj-body>\n    <mj-section>\n      <mj-column>\n        <mj-text font-size=\"16px\">\n        Hello!\n        </mj-text>\n        <mj-text>\n          Order {{ order.number}} has been confirmed.\n        </mj-text>\n      </mj-column>\n    </mj-section>\n    \n    <mj-section>\n      <mj-column>\n        <mj-table>\n          <thead>\n            <tr>\n              <th>\n                Billing address\n              </th>\n              <th>\n                Shipping address\n              </th>\n            </tr>\n          </thead>\n          <tbody>\n            <tr>\n              <td>\n                {{#if order.billingAddress}}\n                  {{ order.billingAddress.streetAddress1 }}\n                {{else}}\n                  No billing address\n                {{/if}}\n              </td>\n              <td>\n                {{#if order.shippingAddress}}\n                  {{ order.shippingAddress.streetAddress1}}\n                {{else}}\n                  No shipping required\n                {{/if}}\n              </td>\n            </tr>\n          </tbody>\n        </mj-table>\n      </mj-column>\n    </mj-section>\n\n    \n  <mj-section>\n    <mj-column>\n      <mj-table>\n        <tbody>\n          {{#each order.lines }}\n            <tr>\n              <td>\n                {{ this.quantity }} x {{ this.productName }} - {{ this.variantName }}\n              </td>\n              <td align=\"right\">\n                {{ this.totalPrice.gross.amount }} {{ this.totalPrice.gross.currency }}\n              </td>\n            </tr>\n          {{/each}}\n          <tr>\n            <td>\n            </td>\n            <td align=\"right\">\n              Shipping: {{ order.shippingPrice.gross.amount }} {{ order.shippingPrice.gross.currency }}\n            </td>\n          </tr>\n          <tr>\n            <td>\n            </td>\n            <td align=\"right\">\n              Total: {{ order.total.gross.amount }} {{ order.total.gross.currency }}\n            </td>\n          </tr>\n        </tbody>\n      </mj-table>\n    </mj-column>\n  </mj-section>\n\n    </mj-body>\n</mjml>",
                            "subject": "Order {{ order.number }} has been confirmed"
                        },
                        {
                            "active": false,
                            "eventType": "ORDER_CANCELLED",
                            "template": "\n<mjml>\n  <mj-body>\n    <mj-section>\n      <mj-column>\n        <mj-text font-size=\"16px\">\n            Hello!\n        </mj-text>\n        <mj-text>\n          Order {{ order.number}} has been cancelled.\n        </mj-text>\n      </mj-column>\n    </mj-section>\n    \n    <mj-section>\n      <mj-column>\n        <mj-table>\n          <thead>\n            <tr>\n              <th>\n                Billing address\n              </th>\n              <th>\n                Shipping address\n              </th>\n            </tr>\n          </thead>\n          <tbody>\n            <tr>\n              <td>\n                {{#if order.billingAddress}}\n                  {{ order.billingAddress.streetAddress1 }}\n                {{else}}\n                  No billing address\n                {{/if}}\n              </td>\n              <td>\n                {{#if order.shippingAddress}}\n                  {{ order.shippingAddress.streetAddress1}}\n                {{else}}\n                  No shipping required\n                {{/if}}\n              </td>\n            </tr>\n          </tbody>\n        </mj-table>\n      </mj-column>\n    </mj-section>\n\n    \n  <mj-section>\n    <mj-column>\n      <mj-table>\n        <tbody>\n          {{#each order.lines }}\n            <tr>\n              <td>\n                {{ this.quantity }} x {{ this.productName }} - {{ this.variantName }}\n              </td>\n              <td align=\"right\">\n                {{ this.totalPrice.gross.amount }} {{ this.totalPrice.gross.currency }}\n              </td>\n            </tr>\n          {{/each}}\n          <tr>\n            <td>\n            </td>\n            <td align=\"right\">\n              Shipping: {{ order.shippingPrice.gross.amount }} {{ order.shippingPrice.gross.currency }}\n            </td>\n          </tr>\n          <tr>\n            <td>\n            </td>\n            <td align=\"right\">\n              Total: {{ order.total.gross.amount }} {{ order.total.gross.currency }}\n            </td>\n          </tr>\n        </tbody>\n      </mj-table>\n    </mj-column>\n  </mj-section>\n\n  </mj-body>\n</mjml>",
                            "subject": "Order {{ order.number }} has been cancelled"
                        },
                        {
                            "active": false,
                            "eventType": "ORDER_FULLY_PAID",
                            "template": "\n<mjml>\n  <mj-body>\n    <mj-section>\n      <mj-column>\n        <mj-text font-size=\"16px\">\n          Hello!\n        </mj-text>\n        <mj-text>\n          Order {{ order.number}} has been fully paid.\n        </mj-text>\n      </mj-column>\n    </mj-section>\n    \n    <mj-section>\n      <mj-column>\n        <mj-table>\n          <thead>\n            <tr>\n              <th>\n                Billing address\n              </th>\n              <th>\n                Shipping address\n              </th>\n            </tr>\n          </thead>\n          <tbody>\n            <tr>\n              <td>\n                {{#if order.billingAddress}}\n                  {{ order.billingAddress.streetAddress1 }}\n                {{else}}\n                  No billing address\n                {{/if}}\n              </td>\n              <td>\n                {{#if order.shippingAddress}}\n                  {{ order.shippingAddress.streetAddress1}}\n                {{else}}\n                  No shipping required\n                {{/if}}\n              </td>\n            </tr>\n          </tbody>\n        </mj-table>\n      </mj-column>\n    </mj-section>\n\n    \n  <mj-section>\n    <mj-column>\n      <mj-table>\n        <tbody>\n          {{#each order.lines }}\n            <tr>\n              <td>\n                {{ this.quantity }} x {{ this.productName }} - {{ this.variantName }}\n              </td>\n              <td align=\"right\">\n                {{ this.totalPrice.gross.amount }} {{ this.totalPrice.gross.currency }}\n              </td>\n            </tr>\n          {{/each}}\n          <tr>\n            <td>\n            </td>\n            <td align=\"right\">\n              Shipping: {{ order.shippingPrice.gross.amount }} {{ order.shippingPrice.gross.currency }}\n            </td>\n          </tr>\n          <tr>\n            <td>\n            </td>\n            <td align=\"right\">\n              Total: {{ order.total.gross.amount }} {{ order.total.gross.currency }}\n            </td>\n          </tr>\n        </tbody>\n      </mj-table>\n    </mj-column>\n  </mj-section>\n  \n  </mj-body>\n</mjml>",
                            "subject": "Order {{ order.number }} has been fully paid"
                        },
                        {
                            "active": true,
                            "eventType": "INVOICE_SENT",
                            "template": "\n<mjml>\n  <mj-body>\n    <mj-section>\n      <mj-column>\n        <mj-text font-size=\"16px\">\n          Hi!\n        </mj-text>\n        <mj-text>\n          New invoice has been created\n        </mj-text>\n      </mj-column>\n    </mj-section>\n  </mj-body>\n</mjml>",
                            "subject": "New invoice has been created"
                        }
                    ]
                }
            ]
        }
    }
]

Try to send an invoice for orders create in this channel Email was sent

krzysztofwolski commented 1 year ago

Updated scenarios for Sendgrid

lkostrowski commented 1 year ago

@szczecha if you have time, please check also Sendgrid scenarios, thanks

szczecha commented 1 year ago

Placeholder for sender details should disappear or be smaller after selecting sender from the dropdown:

App version: 1.2.0

Create a new sendgrid configuration Save Select sender

image

szczecha commented 1 year ago

When saving the configuration without selecting a template, an error may indicate that the template is required

App version: 1.2.0

Create a new SendGrid configuration Save Open one of the event configurations Change event to disabled and save

image
szczecha commented 1 year ago

Impossible to disable an event from SendGrid configuration if the event doesn't have a template

App version: 1.2.0 Create a new SendGrid configuration Save Try to disable one of the events

https://user-images.githubusercontent.com/30683248/227934808-d21d2c30-56b5-42a4-a62f-f5ca1beaf04a.mov