A Push Block is a Library Block which you can use to insert content into push notifications. Library Blocks are useful as they allow you to create pieces of content that you can insert into different communications again and again. When you edit a library block, you make the changes centrally and the blocks update wherever you've used them.
Most Library Blocks use web or email templates. This means they have a lot of HTML code defining their styling and layout. In a push notification, this would cause the HTML code to be sent along with its content, rendering it inappropriate.
With a Push Block, you can apply all sorts of dynamic content to the Block. Most commonly, you'll use a Push Block for Data Lookup Blocks or One-to-Many Blocks. This is because you can apply Person Data parameter, Global Data parameter, and Promotions directly in a Push Notification without the need for a Push Block.
In this article, we cover:
- How to Create a Push Block Template
- How to Create a Push Block
- How to Insert a Push Block in a Push Notification
How to Create a Push Block Template
You must create a Push Block Template as a Content Template, not as a Push Template.
- Open the Assets module and then select 'Templates'.
- Select 'Create template' from the bottom of the left sidebar.
- When the pop-up appears, fill in the name of the Push Block Template in the 'Name' field. Then click 'OK'. You've now created a new template.
- Copy and paste the following template code.
<!DOCTYPE html> <html> <head> <meta charset="UTF-8"> <title></title> </head> <body> <div agblockgroup="on" agid="Push Block Template_group_1"> <div agrepeatingblock="on" agignore="true" agid="Push Block Template_block_1"> <div ageditable="*" agignore="true" agid="Push Block Template_block_1_field_1">Content goes here</div> </div> </div> </body> </html>
- Click 'Save'.
- Select 'Convert to template' from the bottom of the left sidebar.
Your Push Block Template is now ready to use.
How to Create a Push Block
- Mouse over Assets module and then select 'Library Blocks'.
- Select 'Create block' from the bottom of the left sidebar.
- Fill in the name of your Push Block in the 'name' field.
- Select your Push Block Template from the 'Template' drop-down.
- Click the 'Content goes here' field and then click the 'OK' button. You've created a Library Block with the Push Block Template.
- Personalise the content of your Block using the different types of dynamic content.
- Click the 'Save' button.
Now, you've created and configured a Push Block. It's ready for you to insert into a push notification.
A Push Block configured to use a Data Lookup
How to Insert a Push Block in a Push Notification
Before you begin, make sure your Push Template for the push notification has a field which supports Library Blocks.
- Create a Push Notification.
- Select the field which supports Library Blocks.
- Type the name of your Push Block. It will appear in a drop-down menu below the field. Click on your Push Block.
- Click 'Save'.
Now, you've added the Push Block to your Notification Template. You push notification is ready for you to test.
A Push Notification with a Library Block in the message field
Suggested Next Steps