Mechanic is a development and ecommerce automation platform for Shopify. :)
This task illustrates how to use a typeface from Google Fonts, embedding it in a generated PDF which is then emailed to the recipient of your choice.
Runs Occurs when a user manually triggers the task. Configuration includes destination email address.
Mechanic is designed to benefit everybody: merchants, customers, developers, agencies, Shopifolks, everybody.
That’s why we make it easy to configure automation without code, why we make it easy to tweak the underlying code once tasks are installed, and why we publish it all here for everyone to learn from.
(By the way, have you seen our documentation? Have you joined the Slack community?)
mechanic/user/trigger
{% capture html %} <link href="https://fonts.googleapis.com/css2?family=Liu+Jian+Mao+Cao&display=swap" rel="stylesheet"> <style> p { font-family: 'Liu Jian Mao Cao', cursive; } </style> <p>Almost before we knew it, we had left the ground.</p> {% endcapture %} {% action "email" %} { "to": {{ options.destination_email_address__email_required | json }}, "subject": "PDF test", "body": "Please see the attached PDF. :)", "reply_to": {{ shop.customer_email | json }}, "from_display_name": {{ shop.name | json }}, "attachments": { "font-demo.pdf": { "pdf": { "html": {{ html | json }} } } } } {% endaction %}