Skip to main content
The modular approach

Read more about the usage of modules in pharmaceutical companies

eWizard Team avatar
Written by eWizard Team
Updated over a year ago

Overview

The term “modularity” is widely used in technological and organizational spheres.

This approach enables to go through the processes of updating, localizing, approving and reviewing faster, much more productive and cost-effective. The modular approach is aimed at streamlining the editing and approval processes in the context of a multichannel approach with its "Edit/Approve once - publish to many".

The introduction of a new approach is due to many advantages. See the main ones in the chart below.

Business rules

The use of modules is subordinate to several business rules.

Business rule 1 determines the degree of moduled editing. Our framework allows you to configure the ability to edit different components in different ways:

• text editing

• image editing

• color editing

• background editing

Business rule 2 determines the order of placement of blocks and modules in the template. A precise location method is approved.

Business rule 3 determines access to content for a user. Users can only see the content revealed to them. Also, the template's metadata influence on the available content.

Modular-type Content

The eWizard platform introduces two types of entities (Blocks and Modules) within the modular approach. They provide the need to combine simpler components into one element with a more complex structure. You can find them in the items’ editing mode.

A Block: A group of contentless components that are tied in one container [1].

A Module: A group of contentful components that are approved [2].

The common and different characteristics of these entities are the following.

Blocks

The first modular component is a BLOCK.

A block is a contentless entity, in other words a structured blank. The block’s architecture is organized as follows: a set of several elements for which the necessary parameters are registered. Dummy text and images inside are further substituted by the relevant context.

The block structure is as follows:

[1], [1a], [1b], [1c] - Header [2] – Body

Blocks are generic. They allow users to enter a desired text and image, completely without any reference neither to the product, nor to the language, country, brand, etc. When using a template, all components of the block obey parameters of this template.

To manage blocks in Editor, you can click the drop-down list [1]. Here you can find all blocks related to the brand you are currently working on or choose all blocks available for you. You can fill them out with content. Blocks have higher dimensional modularity and degrees of freedom than modules:

• Text editing [2].

Blocks have no distinct lifetime and exhibit flexibility. Blocks and modules are created in accordance with the brand book of the customer’s company. All components layout must be approved.

Modules

The second modular component is the MODULE.

The module is a contentful entity, a ready-made piece of content presented in the form of a ready-made block of the approved form.

The main distinguishing feature is branding as a method of providing the consistent experience for customers. The architecture of the module is the same as the block’s one, but all components are filled with the information previously agreed with the customer. The modules are assigned data to the product, language, country, etc. Ready-made modules can be used in e-Detailers, emails, microsites, call flows and surveys. They require minimal editing, so the modification function is disabled or can be implemented in the context of localization.

A module equates to a specific entity in Veeva Vault.

Email Modules

The Key Message Tracking feature is available for email modules. So, when you publish emails to Veeva Vault as PDF:

• You can assign a key message to each email's module. In Veeva, modules with key message IDs are published as individual entities; they are linked to the PDF published. As a part of the PDF is published, modules and their key message IDs are displayed under the PDF's details Modules tab. The information about the modules used is in the Publishing summary, whereas two additional steps of modules creation in Veeva and linking them to the PDF are added.

• These key messages assigned to email's modules are saved for further publications. So that users can track the performance of each module.

• As a result, once published to Veeva as PDF, email modules are assigned with tracking IDs. These IDs are kept when publishing to SFMC as a newsletter. Further, tracking IDs are used for analytic purposes.

The Approval Process

At the core, modules must go through a full approval cycle.

Further, to create content, users can take only Approved modules. Modules approval takes place in two scenarios:

1) Any item with modules in its structure is sent for approval as a sole document.

2) A separate approval for each module as an entity by the criteria of the product, its testing, effectiveness, and the entire evidence base.

3) Benefits

Development

Block Development

Block Markup

The block itself is represented as a simple Vue component and described in index.vue file of its directory.

Let's try to create our first custom block component. To do so, open a directory @blocks within node_modules directory. After run wiz init block [name_of block] command. After that open index.vue file within name_of_block directory. You can see the next code:

<i18n>
{
"en": {}
}
</i18n><template>
<table cellspacing="0">
<tr>
<td align="center">
<p class="custom-block">Hello world!</p>
</td>
</tr>
</table>
</template><script>
export default {
name: 'custom-block',
}
</script>

So, after we should add block to our template. To do this we need add some code to our script in App.vue (main email file):

<script>
import customBlock from "./node_modules/@blocks/custom-block"
export default {
name: 'wiz-app',
components:{ customBlock }
};
</script>

Now, lets add a picture to our block component! 1) Create public foulder within @blocks/custom-block. 2) Put the picture here. 3) Connect the image using scripts.

<script>
import customImage from "./public/some_picture.png"
export default {
name: 'custom-block',
data: function () {
return {
customImage
}
}
}
</script>

4) The last part of adding picture, adding wiz-image component.

<wiz-image: src="customImage" link="https://viseven.com/"></wiz-image>

To show block on template, implement such code to html within App.vue:

<customBlock></customBlock>

Our image-block component is ready: run wiz dev --live to see.

Block Styling

To style the block component add <style> tag into its index.vue file and define there css code to fit the block content your design. It is a common practice to make a stylesheet with commonly used css classes and reuse them while developing the custom blocks.

Upon the necessity, CSS code may be inlined in the HTML elements.

<i18n>
{ "en": { "title": "
<div style='line-height: 20px;text-align: left;'>
<span style='color:#0096db;font-size: 29px'
>Lorem ipsum dolor sit amet consectetur</span
>
</div>
" } }
</i18n><template>
<wiz-layout
align="center"
type="horizontal"
class="my-block full-width border-collapse"
:grid="layoutGrid"
>
<wiz-layout :css="{minHeight: '10px'}">
<wiz-text :text="$t('title')"></wiz-text>
</wiz-layout>
<wiz-layout :css="{minHeight: '40px'}">
<wiz-image
:src="placeholderImage"
style="padding-right:20px; padding-bottom:20px"
></wiz-image>
</wiz-layout>
</wiz-layout>
</template><script>
import placeholderImage from './public/default-image.jpg';export default {
name: 'my-block',
components: {},
data: function() {
return {
placeholderImage,
layoutGrid: [
{ paddingTop: "20px", paddingLeft: "20px" },
{ paddingTop: "20px" }
]
};
}
};
</script>
<style>
.my-block {
background-color: lightblue;
}
.border-collapse {
border-collapse: collapse;
}
</style>

Result:

To manipulate styles of the elements, the eWizard.js component wiz-layout has special props such as:

css - used to pass the styles inlined in the root element of the wiz-layout component; • grid - used to pass inlined styles to table cells that wrap nested elements of wiz-layout;

Refer to wiz-layout props to get acquainted with props syntax, format and explanation.

Block Metadata

The eWizard editor takes out the information about the blocks from the blocks.json file in root of the blocks-library directory and adds all the blocks denoted in blocks.json to the sidebar.

Also, blocks.json contains meta-information with block content description. That information is showed in when a user hovers the mouse upon a block in the sidebar.

Each block from the blocks-library should be described as an object in the components array of the blocks.json file with the following structure:

{
"id": "custom-block",
"name": "Custom block",
"model": {},
"icon": "node_modules/@blocks/custom-block/icon.png",
"metadata": []
},

Each object in metadata is rendered as a new string with helpful information, that appears when the user moves the mouse pointer over a block in the sidebar. That information may help the user understand which type of content block exists and find out the content description and properties.

As a result, the following sidebar tooltip of custom-block may appear:

![Image](@images/block-library-add.png)

Adding Blocks in the eWizard Editor

To add new blocks to an email, switch left sidebar to the Blocks tab and drag the block to a required position in the email.

The eWizard editor automatically adds the block from the block-library to common/blocks/ directory with a new name.

Component Development

Because this is not a presentation and a component can't be interactive, it is better to use already existing components that were developed by our teams. However, if you want to you can create your components.

Component directory Structure

.
└─
└─.ewizard
|  └─ settings.json #contains the project settings and plugins configuration
├─ package.json # npm manifest
├─ index.vue # component code should be here
├─ demo/ # demo presentation directory
└─ media/ # media directory
├─ images/
├─ video/
└─ fonts/

Component Development Guidelines

1) Follow official Vue guidelines 2) Add the wiz-component-name class to the root element of the component 3) Define props according to the eWizard.js guidelines

Creating a component

Run wiz init command and pick the component from the given preset.

$ wiz init
? Choose a template you want to use: (Use arrow keys)
email
e-Detailer
survey
> component

Localization

As has been said all localization keeps in the App.vue file of the block.

<i18n>
{
"en": {
"title": "Text sample",
}
}
</i18n>

Tokens

What is a Token?

A token is a bit of a specific code that allows you to insert unique user data into emails. The most common example of this would be a tag like FNAME that allows you to insert the first name of the customer into an email.

Why are tokens used?

It is all about personalization! A reader is much more likely to open an email from you if you address them by the name. This helps grab their attention, and it also helps build a personal relationship with the reader.

Each mailing platform has its own tokens. For example, MailChimp:

• View Online: *|ARCHIVE|* • Account First Name: *|FNAME|* • Account Last Name: *|LNAME|* • User Name: *|LIST:NAME|* • User Email: *|LIST:EMAIL|* • Unsubscribe: *|UNSUB|*Other tokens

Example of Usage

Dear *|FNAME|* *|LNAME|*,
<a href="*|UNSUB|*">Unsubscribe from this list</a>

Styles

When developing a letter, when we only create the structure of components we need, we can write styles as it is customary in Vue.js for a single-file components.

Dev build is based on modern technologies, so the development is simple and understandable for anyone familiar with modern CSS. But some email clients don't adapt so quickly to the new technologies.

They are stuck somewhere in the 90', so they don't understand separately connected styles and modern js frameworks. Therefore, all your components are rebuilt into a regular HTML document, and all styles are written inline with each element to which they are attached.

Development build

Production build

In the images, you can see that all the styles linked to the element (normally written or inline) are built as inline styles.

But the styles for mobile email clients are slightly different. Mobile email clients have been developed for the modern Internet with the latest technology in mind. They understand tags.

So we have to write them as media queries, but we have to add !important. This must be done in order to take priority over inline styles.

In production build all styles are moved to the top of the page, inside the <head> tag.

For Development Only

In this eWizard.js version if you want to see the results of your development you need to go to App.vue, import the block that you want to test and put its tags in the layout.

In production and higher versions eWizard.js, handles iе.


Conclusions

Thereby, the modular approach means standardizing the content creation process since modularity is impossible without some level of standardization. This will greatly make content generation and localization way faster.

Did this answer your question?