Align to Center the Button in Confirmation Email

Topic summary

Goal: Center the action buttons in a Shopify order confirmation email template.

Context: The original attempt (using the same approach as logo/paragraph centering) didn’t work. One reply asked for the site URL; another provided a concrete template edit using inline CSS.

Fix provided:

  • Admin > Settings > Notifications > Customer notifications > Order confirmation > Edit code.
  • In the template:
    • After the first occurrence of class=“actions__cell”, add an inline style to center via flexbox: display: flex; justify-content: center;
    • After class=“link secondary-action-cell”, add: margin-top: 0
  • Save changes.

Result: The buttons render centered in the confirmation email. The original poster confirmed the solution worked and shared a screenshot. Images in the thread illustrate before/after alignment but are not required to apply the fix.

Status: Resolved. No outstanding questions or disagreements.

Summarized with AI on December 19. AI used: gpt-5.

Just want to ask how to set these Buttons here to center in Confirmation Email?

I have tried to insert code same on the logo and paragraph but it is not working. Thank you!

HEllo @Joshua2
It seems like the text inside your button is aligned in the center.
to align button in the center, please provide URL of your website.

@Joshua2 Please follow the steps below to center the buttons in the order confirmation email:

  1. From the admin panel, go to “Settings” → “Notification”.
  2. Click on “Customer notifications” → “Order confirmation”.
  3. Click "Edit Code".
  4. Paste the following code in the specified places as shown in the screenshot:
    a. After **class="actions__cell"** (at the first occurrence), paste:
style="display: flex; justify-content: center;"

b. After **class="link secondary-action-cell"**, paste:

style="margin-top: 0"

  1. Save the changes.

Result will be like,

Please support us by clicking “Like” and “Accepted” if our solution works for you. Thanks for your support.

1 Like

It worked! thank you so much for the help!