This blog post captures some of the process This blog post captures some of the process and code tips and tricks used to create a PDF template for FPN and other modules.
...
On the first page of the creation, wizard pick HTML and pick the "Load Sample HTML" option (the MS Word option will be phased out, and has been kept for a while to support last years users).
The top large text area is the "Letter Contents", this is where the main template goes into, you can identify keywords and change them in here. It may be easier to copy the text out into a better HTML text editor then paste it back in when you are done. NOTE this letter contents section is not a FULL HTML page on its own, it is 3/4 of a page.
The 2nd large text area is the "Additional CSS", this is where formatting rules are applied, such as font, font size, spacing, colours etc.
You can upload your PDF letterhead temp[late and set the margins for the first page. Note you can set the Addressee details location to fit in a windowed envelope, this location is set irrespective of the rest of the page, to ensure it is exactly where it needs to be regardless of where other information may flow to see the information on the <address> tag further below.
When you are done, save the record. On the next page, you can preview the merge letter. What it does is merge the current Merge Letter with the first record in the current event. So it will help to make sure that record has photos, notes and details that will test the template properly, you may need to work in a test event for this.
Listing the Merge Tokens
From the mail merge settings page, Administration→Settings→Merge Templates select any of the templates records.
...
Code Block | ||
---|---|---|
| ||
<!-- The address block can be positioned for windowed envelopes by uncommenting the positioning CSS --> <address> {if $item.overrideOwnerDetails$overrideOwnerDetails} {$item.overrideOwnerDetails$overrideOwnerDetails|nl2br} {else} {$assetContact.fullName} <br /> {$assetContact.address1}<br/> {$assetContact.address2}<br/> {$assetContact.address3} {$assetContact.address4} {/if} </address> <article> <!-- Put one box to the left and one to the right to format the top bit--> <p class="left-box"> <strong>I direct:</strong> <!-- Leave a big space here for the address window, which was defined above and is absolutely positioned here --> <br /> <br /> <br /> <br /> <br /> </p> <p class="right-box right-text"> <strong>Notice #{$item.id$noticeNumber}</strong><br /> Issued {$MERGE_DATE}<br /> <br /> <em>The owner or occupier of:</em> <br /> {$item.Asset.friendly} <br /> Property No. {$item.Asset.friendlyCode} </p> </article> |
...
Code Block | ||
---|---|---|
| ||
<div class="left-box"> <p> <strong>I direct:</strong> <br /> {if $item.overrideOwnerDetails$overrideOwnerDetails} {$item.overrideOwnerDetails$overrideOwnerDetails|nl2br} {else} {$assetContact.fullName} <br /> {$assetContact.address1}<br/> {$assetContact.address2}<br/> {$assetContact.address3} {$assetContact.address4} {/if} </p> </div> <div class="right-box"> <p> <strong>Notice #{$item.id$noticeNumber}</strong><br /> Issued {$MERGE_DATE}<br /> <br /> <em>The owner or occupier of:</em> <br /> {$item.Asset.friendly} <br /> Property No. {$item.Asset.code} </p> </div> <br /> |
...
Code Block | ||
---|---|---|
| ||
<h2> To do the following work in respect to land at {$item.Asset.friendly} by {$IN_THREE_WEEKS}. </h2> |
Right box with right justified text
Notice here now the box and text CSS rules are added together to position the text to the right side ofht page,, and also align the text.
Alternatively, you can use the due date of the item. Note - use the custom {$due} token for this. This will display in the correct date format of dd/mm/yyy and is also useful if you have Process Workflow Updates on Items turned off for your template. If Process Workflow Updates on Items is turned off, it will still calculate what the due date will be and it will appear in the letter even though it doesn't update the item.
Code Block | ||
---|---|---|
| ||
<p class="right-box right-text"><h2> To do <strong>Notice #{$item.id}</strong><br /> Issued {$MERGE_DATE}the following work in respect to land at {$item.Asset.friendly} by {$due}. </h2> |
Right box with right justified text
Notice here now the box and text CSS rules are added together to position the text to the right side ofht page,, and also align the text.
Code Block | ||
---|---|---|
| ||
<p class="right-box right-text">
<strong>Notice #{$item.id}</strong><br />
Issued {$MERGE_DATE}<br />
<br />
<em>The owner or occupier of:</em>
<br />
{$item.Asset.friendly}
<br />
Property No. {$item.Asset.code}
</p> |
...
Token | Description |
---|---|
{$MERGE_DATE} | The date which merge document has been generated. |
{$MERGE_DATETIME} | The date and time which merge document has been generated. |
{$IN_TWO_WEEKS} | The date 2 weeks from today. |
{$IN_THREE_WEEKS} | The date 3 weeks from today. |
{$IN_FOUR_WEEKS} | The date 4 weeks from today. |
{$item.due$due} * | shows date & time like Displays the date in the format of: 15/08/2021 12:00:00 AM Use the flowing code to extract the date part only {assign var=due value=" "|explode:$item.due} This token is also useful f you have Process Workflow Updates on Items turned off for your template. If Process Workflow Updates on Items is turned off, it will still calculate what the due date will be and it will appear in the letter even though it doesn't update the item. |
*NOTE: if you use {item.due$due} (which is the Next Action Date) any FPN records with no due date will have the default date of two or three weeks set before it prints
...
Currently there are three override fields on the FPN form which are listed below along with the tokens you need to use for these fields for them to appear in the letter:
- Override Owner Details
- Override Property Number
- Override Location
{$item.overrideOwnerDetails}
{$item.overridePropertyNumber}
{$item.overrideLocation}
The Override Owner Details token should already exist in your template. However you will need to manually add the other ones the tokens you need to use for these fields for them to appear in the letter:
- Override Owner Details
- Override Property Number
- Override Location
{$overrideOwnerDetails}
{$item.overridePropertyNumber}
{$item.overrideLocation}
The Override Owner Details token should already exist in your template.
Multiple Override Owner Details
You can add multiple override owners into the Override Owner Details section of your Fire Prevention Notice. Each owner should be separated by a hyphen on a new line which will then generate separate letters for each override owner. Below is an example of how to add multiple override owners.
In this example two letters will be created, one for Fred Smith and one for Nathan Jones. The token {$overrideOwnerDetails} will automatically work with any multiple override owner details entered.
You many need to enter the below tokens manually if you want them to appear in the letter.
...
Code Block | ||||||
---|---|---|---|---|---|---|
| ||||||
<!-- The address block can be positioned for windowed envelopes by uncommenting the positioning CSS --> <address> {if $item.overrideOwnerDetails$overrideOwnerDetails} {$item.overrideOwnerDetails$overrideOwnerDetails|nl2br} {else} {$assetContact.fullName} <br /> {$assetContact.address1}<br/> {$assetContact.address2}<br/> {$assetContact.address3} {$assetContact.address4} {/if} </address> <article> <div class="top-heading center-text"> <h2>SCHEDULE 15</h2> <h3>Country Fire Authority <br> Regulations 2014 <em>Reg. 112 (1)</em></h2> <h1>FIRE PREVENTION NOTICE</h1> </div> <br /> <br /> <!-- Put one box to the left and one to the right to format the top bit--> <div class="left-box"> <p> <strong>I direct:</strong> <br> <!-- The <address> block above is positioned under this phrase --> </p> </div> <div class="right-box right-text"> <p> <strong>Notice #{$noticeNumber}</strong><br /> Issued {$MERGE_DATE}<br /> <br /> <br /> <em>The owner or occupier of:</em> <br /> {if $item.overrideLocation} {$item.overrideLocation} {else} {$item.Asset.friendly} {/if} <br /> Property No. {if $item.overridePropertyNumber} {$item.overridePropertyNumber} {else} {$item.Asset.friendlyCode} {/if} </p> </div> <!-- Leave a big space here for the address window, which was defined above and is absolutely positioned here --> <br /> <br /> <!-- Here's a centred warning box with warning text inside --> <p class="warning-text warning-box center-text"> <strong>Failure to comply with this notice will result in a fine of $1,652 being issued.</strong> <br /><br /> Penalty amounts are determined under the <em>Country Fire Authority Act 1958.</em> <br /> The amount of a penalty unit increases annually on 1 July under the <em>Monetary Units Act 2006</em>. </p> <!-- Now a series of paragraphs follow. Just use basic HTML such as p/h1/h2/h3, ol/ul/li, strong/em and br --> <h2> To do the following work in respect to land at {$item.Asset.friendly} by {$IN_THREE_WEEKS}. </h2> <p> {$conditionsAll} <!-- TODO: This should become an array with ol/li formatting, but {$conditionsAll} doesn't yet support that --> </p> <!-- if there are special notes, add another paragraph --> {if $specialNotes} <h2>Special Instructions:</h2> <p>{$specialNotes}</p> {else} <br /> <!-- keep some space when there are no notes space --> {/if} <p> <em>These works are necessary to protect life or property from the threat of fire.</em> </p> <br /> <p class="warning-text center-text"> If you are unable to complete the work by the due date contact 03 YOUR PHONE NO </p> <br /> <br /> <!-- Signature block --> {$ASSIGNEE_SIGNATURE}<br /> <strong>{$ASSIGNEE_NAME}</strong><br /> {if $ASSIGNEE_SIGNATURE_TEXT} {$ASSIGNEE_SIGNATURE_TEXT}<br /> {else} Fire Prevention Officer<br /> {/if} {$MERGE_DATE} <br /> <!-- Page two is created only if there are attached media --> {if $media} <hr /> <br /> <h1 class="center-text">Evidence</h1> <p> {foreach from=$media item="inspectionPhoto"} <img class="media" src="{$inspectionPhoto}"> {/foreach} </p> {/if} <!-- End of page two media --> <!-- Here's the last page is the T&Cs --> <hr /> <br /> <h1 class="center-text">Explanatory Note for a Schedule 15 Fire Prevention Notice </h1> <div class="small-text justify-text"> <h2>Power and Purpose</h2> <p> The Municipal Fire Prevention Officer of the Council has the power under section 41 of the <em>Country Fire Authority Act 1958</em> to issue this notice. </p> <p> The purpose of this notice is to require to you take the necessary steps to protect your life and property, and that of your neighbours, from the threat of fire. </p> <h2>Effect of not complying with this notice</h2> <p> If you do not comply with this notice within the time specified or you do not lodge an objection (see below): <ul> <li> The Municipal Fire Prevention Officer may arrange for the Council, a fire brigade or other contractor to enter upon your land and take the steps specified in this notice. The Council will then send you an account for the cost of taking these steps. If you do not pay the account, the Council can take you to Court to recover the cost including interest on the money owed (see sections 225 and 232 <em>Local Government Act 1989.</em>) </li> </ul> In addition: <ul> <li> The Municipal Fire Prevention Officer may serve you with a Fire Prevention Infringement Notice (“infringement notice”) for failing to comply with this notice and requiring you to pay a penalty of 10 penalty units within a specified time (Not less than 21 days after the infringement notice has been served). Failure to pay the infringement penalty by the due date may result in further enforcement action being taken which may incur further costs. </li> </ul> Or <ul> <li> Proceedings may be taken against you for a failure to comply with this notice. If proceedings are taken, you can be fined up to 120 penalty units or imprisoned for a period of up to 12 months, or both (see section 41D(1) <em>Country Fire Authority Act 1958.)</em> </li> </ul> </p> <h2>Objection</h2> <p> You can object to this notice if you wish (see section 41B <em>Country Fire Authority Act 1958</em>,) by lodging your objection with the Municipal Fire Prevention Officer within 7 days of the service of this notice, stating your grounds of objection. </p> <p>Within 14 days of lodging an objection, the Municipal Fire Prevention Officer must confirm or vary this notice (specifying the new time within which you must comply) or withdraw this notice. </p> <h2>Appeals</h2> <p> If you have lodged an objection and the Municipal Fire Prevention Officer fails to confirm, vary or withdraw the notice within 14 days, or you are not satisfied with a confirmation or variation of the notice, you may appeal in writing to the Chief Officer (see section 41C <em>Country Fire Authority Act 1958.</em>) </p> <p> Appeals must: <ol> <li> Be in writing; </li> <li> Be lodged with the Chief Officer, Country Fire Authority, 8 Lakeside Drive, East Burwood, 3151, within 7 days of the 14 day period described above, or within 7 days of the confirmation or variation (whichever is earlier); </li> <li> Fully state the grounds of your appeal. </li> </ol> </p> <p> The Chief Officer (or a delegate) will then consider whether your appeal is valid. To do this, an investigation will be made of your case. In the course of the investigation, an officer of the Country Fire Authority may visit you to assess the matter. When considering your appeal the Chief Officer (or a delegate) will take into account all relevant circumstances, including the proper needs of conservation, and any alternative means of addressing the threat of fire. </p> <p> After considering the appeal, the Chief Officer (or a delegate) must either confirm, vary or cancel the notice. You will be notified in writing of the decision. </p> <p class="center-text"> <strong>If you have any enquiries, please contact the Municipal Fire Prevention Officer at Council.</strong> </p> </article> |
...