DEV Community

Cover image for Custom components in CompuSoft's Composer
Morten Hartvig
Morten Hartvig

Posted on

Custom components in CompuSoft's Composer

Composer is CompuSoft's product for easily creating emails related to bookings, invoices and whatever else you might have used and/or is currently using emails for.

Composer is included in your subscription and can be access in CompuSuite by going to Settings -> Document Templates -> Composer.

The article will assume you have some knowledge of Composer or similar email builders.

Components to the rescue

Once you get started (and hooked) on using the Composer you will quickly find that some items are often repeated in your emails, such various branding visuals, buttons and text.

To make it easier for you to reuse items the Composer allows you to create custom components. Components are essentially just "blocks" that can be dragged and dropped into your other emails*, thus giving you the option for better reusability.

* The template/markup for your email in Composer is often referred to as a "form".

Creating components for better reusability

The example below will use a Branding header as an example component. When inserted into Composer forms it will display a company logo along with the customer's name (the customer being the individual eventually receiving an email using this form).

1 Go to Composer in CompuSuite and click + Create new

Image description

2 You will have the option to choose from a template. Templates will be covered in a later post. For now simply click on Empty document

Image description

3 You will now have a new, unsaved Composer form. Click on Settings in the top left and provide a name for the new component

Image description

4 Insert an image and text block by clicking on them and provide whichever information your would like

Notice how the text on the image says {{ "Hej" | translate:6249 }} {{ Customer.Name }}. Composer supports a template language called Liquid, which will be covered in depth in another post.

{{ "Hej" | translate:6249 }} will insert the translation item with the given id (6249) from the CompuSuite translator library, making sure the text is always translated correctly for the customer's local language.

{{ Customer.Name }} will insert the name of the customer when the email is sent.

Image description

5 Click Save and Close in the bottom right, set the type to Component and click Save

Image description

6 Components can be found under Components on the Composer page, including built-in components provided by CompuSoft.

Note that you can only edit your own components.

Image description

Using your custom component in an email

With a component created it is time to insert it into an email.

1 Go to the Composer page in CompuSuite and create a new empty form just like in the previous step 1

2 Looking at the components available to the right you will see Branding - Header, which can be inserted by clicking on it

Image description

3 You can expand the component to see the contents of it by toggling the arrow

Note that some information (such as {{ Customer.Name }}) will not be visible in the editor as the information is not available at this level.

Image description

4 Clicking the three dots followed by Preview will allow you to preview the form

Image description

5 On the right-hand side you can select a customer to preview the form as

Notice how the customer's name is inserted correctly in the component.

Image description

Your new component can be inserted into any new Composer email and will make it a lot easier to reuse the (in this case) branding for the header of the email :)

Top comments (0)