How to include links and dynamic links in templates.
When including links in your e-mail templates remember that you can include dynamic content. This is where the precise link will vary depending upon the client and potentially even job that it relates to.
Here we show a brief example of how to do this:
- Firstly read the general guidance on creating a template or a footer and this guidance on including links.
- A dynamic link will have a URL that is partly fixed and partly derived from a client or job field(s). For example if I have a Google Drive folder set up for each of my clients then I would need part of the URL to be the same in all cases and part to be client specific, as follows:
- Part 1 would be the same in all cases: https://drive.google.com/drive/folders/[part 2 goes here]?usp=sharing so I can type this into my URL field on the link settings.
- Part 2 is the code that uniquely refers to this folder, for example: 0B45W-1g2qxXmTkR2bC1RNnlYVAT this is different for every client so I can not type this in, instead I need to refer to a field.
- Firstly set up your link and include the fixed part of the URL.
- You need a client or job field(s) to hold the dynamic part of the URL. If it does not already exist set up a client/job field to hold this information. Where your dynamic content could be longer than 20 characters you should use the data type String (long). If it is guaranteed to be shorter than 20 characters (e.g. if you were including a company registered number) then you should use the data type String (short). The number data type would also work where the dynamic part of the URL is guaranteed to be a number and in rare cases the staff type may too (where guaranteed to be user initials).
- To include this field in your URL you need to first add it to the body of your template. Custom client fields are in the Client data drop down and custom job fields are in the Job data drop down. Click on the field and it will be added to the template wherever your cursor is.
- Once added a code will appear in your template, for example {Job.IR[477]}. The reference to 477 is the unique code for the field, this means you can change the name of the field without effecting your templates. Either copy or cut this from the template, click on your linked text and click on the icon to Insert/edit link (the middle icon). This will open the link editor and you can paste your field reference e.g. {Job.IR[477]} into the appropriate place in the URL. Ensure you include all the brackets and do not leave any unnecessary spaces.
- Click ok to save the change to the link.
Please test the use of dynamic links before deploying them on real clients. With a field included in a template we highlight it red where there is a problem, for example if you accidentally delete the final bracket etc. We can not do this in the link editor and so it is very important you test them.