Skip to main content

Notification Emails

1. General description

The Templates module defines standardised email bodies and subjects used across Website, BackOffice and Laravel to contact Users (professionals), Clients and Admin, driven by specific events or manual actions described in the template metadata and content text in Template.csv.

Each template row stores a subject, HTML content with placeholders (for example @@CLIENT_NAME@@, @@USER_FULLNAME@@), and identifiers for grouping, country and profession, so the same business event can generate context-appropriate notifications for different practice areas or jurisdictions.

2. Business goals & objectives

  • Standardise wording for recurring operational emails such as “Urgent! Contact Client Reminder”, “Further Assistance Required?”, and invoice or credit note notices, reducing drafting time and inconsistency across the network.
  • Ensure that key lifecycle events (new enquiry assignment, contact attempts, overdue tasks, invoices due, GDPR requests) always generate a traceable, pre-approved communication that can be searched in the Wiki by subject line or content snippet.
  • Support localisation by linking templates to CountryId and ProfessionId, allowing different introductions and legal explanations while keeping the triggering events and recipients aligned with the same underlying workflow.

3. Detailed behaviour & step by step flow

3.1 Template structure and fields

The CSV defines for each template an internal Id, TemplateGroupId, CountryId, ProfessionId, optional TypeCategoryId/TypeId, human-readable Subject, HTML Content, and CreatedDate, which together allow the sending system to look up the correct template for a given context and render it with runtime data.

Content is stored as HTML fragments including paragraphs, headings and links, and uses token placeholders (for example @@URL_UPDATES@@, @@INVOICE_NUMBER@@, @@TASKTITLE@@) that must be substituted at send time by the BackOffice or Laravel services responsible for the triggering event.

text

3.2 Triggered templates for Users (professionals)

  • Lead and contact management: “Urgent! Contact Client Reminder” (Ids 23, 1334, 1335) reminds the User that a new lead relating to @@CLIENT_NAME@@ was sent at @@CLIENT_ENQUIRY_DATE@@/@@CLIENT_ENQUIRY_TIME@@ and instructs them to call before a due date and update the Updates Record, with deep links such as @@URL_UPDATES@@ for direct access.
  • Strategy/assignment notifications: “Action Required: New Enquiry from Advocate Abroad (@@CLIENT_FULLNAME@@)” (Id 105) emails the User the details of a new enquiry and links to @@URL_STRATEGY@@, explaining how to log unsuccessful calls via Strategy Guide actions.
  • Tasks and compliance: Templates “Pending Task @@TASKTITLE@@ due in 24 hours” (Id 269) and “Pending Task @@TASKTITLE@@ due in 7 days” (Id 270) warn Users that an outstanding task will affect their ability to receive new enquiries if not completed by @@TASKDUEDATE@@.
  • Invoice lifecycle for Users: “Your Advocate Abroad Invoice Has Been Prepared” (Id 92), “Your Advocate Abroad Invoice is Available” (Id 94), “Urgent! You have an invoice due to be paid” (Id 48), “Your Advocate Abroad account access will soon be restricted” (Id 50), and “Advocate Abroad Account access restricted” (Id 49) guide Users from invoice preparation through due date, to warnings and eventual account blocking, including payment instructions using @@ACCOUNT_NAME@@, @@ACCOUNT_IBAN@@ and related fields.
  • Payments and receipts: “Your Advocate Abroad Receipt” (Id 93) confirms payment of Invoice @@INVOICE_NUMBER@@ and thanks the User, closing the loop on the billing cycle.
  • Consultation monitoring: “You have a consultation open for a long time” (Id 1331) reminds the User that consultation @@CONSULTATIONNAME@@ has been open for 7 days and provides a link @@URL_CONSULTATION@@ to continue or eliminate it.
  • Performance and access control: “Unaccessed client waiting for admin action” (Id 1336) warns the User that a client @@CLIENT_FULLNAME@@ has been returned to admin after 48 hours without being accessed, signalling a breach of follow-up expectations.
  • System-generated follow-up info: “An email was sent on your behalf” (Id 1343) informs a User that an automatic email was sent to @@CLIENT_FULLNAME@@ when they could not be reached by phone, with a link to the current Strategy Guide @@URL_STRATEGY@@.
  • Network guidance: Templates such as “Auto CC All Mails” (Id 17), “Landlord/Tenant Dispute Strategy” (Id 98) and “Advice” (Id 315) provide non-client-facing guidance and scripts to Users on how to configure email BCCs, approach typical case types and handle fee discussions or objections.

3.3 Triggered templates for Clients

  • Initial intake and introductions: Multiple “Introduction” templates (Ids 78–91 and related) target different professions and services (for example architects, accountants, lawyers, translators, private detectives) and introduce @@USER_FULLNAME@@, their regulatory body @@USER_PROFESSIONALBODY@@ and licence @@USER_LICENSENUMBER@@ to @@CLIENT_NAME@@ as part of first contact.
  • Enquiry follow-up: Groups 80 and 81 include several “Your Advocate Abroad Enquiry” and “Further Assistance Required?” templates (Ids 31–58, 51–57, 1337, 1340) for various service types (tax, business set-up, architecture, translation, investigations) that check whether the client still requires assistance and solicit feedback, often referencing prior contact attempts and the specialist @@USER_FULLNAME@@.
  • Call attempts: Templates such as “Your Advocate Abroad Enquiry” with language “has tried to contact you to offer assistance” (for example Ids 51–57, 81) are used after unsuccessful phone calls to confirm continued interest and propose further contact.
  • Property and tax lifecycle communications: “Your Property Tax & Fiscal Obligations in Spain” (Id 59) and the related “Notification before sending property mail to @@CLIENT_FULLNAME@@” (Id 60) explain IRNR, IRPF, tourism permit, wealth tax, fiscal representation and associated services and are scheduled after a property purchase, subject to a per-client “Send Property Email” switch in the client details.
  • Ongoing tax compliance: Templates “M210 (VAT for Tourist Rentals) & IRNR” (Id 95), “IRPF Annual & Wealth Tax” (Id 96) and “Modelo M720” (Id 102) inform Clients when it is time to prepare specific Spanish tax declarations, describe obligations and deadlines, and list supporting documentation to provide.
  • Billing towards Clients: “Your Advocate Abroad Credit Note is Available” (Id 27) explains a credit note, outstanding invoices and balance payable, and provides Advocate Abroad SL bank details for client payments.
  • GDPR data rights: “You asked us to access your data” (Id 61), “You asked us to remove your data” (Ids 63–64) provide responses and attach appropriate request forms, consistent with GDPR access and deletion obligations.
  • Service-specific propositions: Templates such as the detailed non-resident landlord/IRNR explanation, fiscal representation offers, and insurance/financial services paragraph in Id 59 provide additional value-added service suggestions tied to ownership or residency status.
  • Consultation and meeting confirmation: “Our next meeting” (Id 1341) confirms a scheduled discussion for @@CLIENT_NAME@@ with @@USER_FULLNAME@@, describing profession and jurisdiction and providing the date/time placeholders @@DUEDATE_DAY@@, @@DUEDATE_DATE@@, @@DUEDATE_TIME@@ plus @@VIDEOCALLMESSAGE@@.
  • Lead reactivation: Templates titled “Your Advocate Abroad Enquiry” and “Further Assistance Required?” (including Id 1339) are also used to reactivate dormant leads and determine if the case should be progressed or eliminated.
  • Contact authorisation: “Advocate Abroad - We need your authorization” (Id 48) requests that the client click @@AUTHORIZATION_URL@@ to accept a specific privacy statement before the enquiry can proceed.

3.4 Templates involving Admin and referrals

  • “Payment share notification from @@REFERRER_NAME@@” (Id 103) notifies a User that a bonus payment has been received from @@REFERRER_NAME@@ related to @@CLIENT_FULLNAME@@, with a link to further details.
  • The group “Your Advocate Abroad Invoice Has Been Prepared” and related billing templates reference internal URLs such as @@URL_INVOICES_PENDING@@ and @@URL_INVOICE_DETAILS@@ that Admin and Users can use to validate payment declarations in BackOffice before invoice issuance.
  • Several templates encode Admin review workflows, for example “@@USER_NAME@@ requested contact by email” (Id 328) directs Admin to approve or reject via @@URL_CONTACTREVIEW@@, followed by approval/rejection templates (Ids 329–330) to the User confirming the decision.

3.5 Automatic vs manual triggering

  • Templates explicitly referencing time-based conditions and “will be sent automatically” (for example the property email pre-notification Id 60, consultation open for 7 days Id 1331, and task due reminders Ids 269–270) are designed for automatic triggering by background jobs or scheduled processes without manual intervention.
  • Other templates are implicitly triggered by specific UI actions, such as pressing “Didn’t Answer” in Strategy Guide, changing status fields, or completing tasks that cause the system to email Users or Clients; these are system-driven but initiated by User or Admin actions rather than free-form manual email composition.
  • A smaller subset appears to be used manually inside the email editor (for example introductions and some strategic advice texts) where Users choose an appropriate template to insert when writing bespoke communications.

4. Confusions, edge cases & known issues

The CSV itself does not document concrete confusion reports, but the existence of near-duplicate subjects such as multiple “Your Advocate Abroad Enquiry” templates across TypeId and ProfessionId suggests a risk that developers or Admin may select the wrong template if group and type keys are not clearly mapped in code.

Templates that include partially specified text like “TO BE SPECIFIED @@SIGNATURE@@” or placeholders for 20** years indicate work-in-progress variants that must be completed or excluded from production selection to avoid sending incomplete or legally ambiguous content.

5. Permissions & access rules

The CSV does not define explicit role-based permissions, but subjects and content show that certain templates are clearly intended only for Admin (for example account access restriction notices, payment share notifications, data access/deletion forms) while others are for Users or Clients, so the implementation must enforce who can trigger each group.

Templates containing internal URLs to BackOffice sections (for example @@URL_UPDATES@@, @@URL_INVOICES_PENDING@@, @@URL_CONSULTATION@@, @@URL_CONTACTREVIEW@@) should only be included in emails to Users or Admin with the necessary platform access, not to Clients.

6. Data model & configuration

The Template.csv structure implies a simple configuration model where each row is a template record with core fields: Id (primary key), TemplateGroupId (logical grouping), CountryId (nullable), ProfessionId (nullable), TypeCategoryId/TypeId (nullable classification), Subject, Content, and CreatedDate.

Groups like 79, 80, 81, 93, 1145 and others cluster related templates (for example introductions, enquiry follow-ups, fiscal notifications) so application code can select the correct language variant by combining group id, country, profession and type keys, rather than hard-coding template Ids.

7. Integrations & external systems

Some templates embed external URLs and services, including Advocate Abroad website links (for example service pages in the property tax email), mailto: links to smcgrath@advocateabroad.com and facturacion@advocateabroad.com, and an unsubscribe link @@URL_USER_UNSUBSCRIBE@@ for account-related emails.

The unsubscribe footer template (Id 1158) provides a standard legal footer with opt-out and company registration information, intended to be appended to mandatory account emails, and must integrate with the system that manages user-level notification preferences.

8. UI & UX expectations

From the content it is clear that templates are referenced from BackOffice UI elements such as “All Actions” in the Strategy Guide, “Send Email” buttons, and task/consultation management screens, where the User expects the system to pre-fill the email body and subject with an appropriate template.

When an email is generated, tokens like @@CLIENT_NAME@@, @@USER_FULLNAME@@ and @@URL_STRATEGY@@ must be shown as fully substituted values to the sender before dispatch where possible, ensuring that Users see exactly what the client will receive and can cancel if details are incorrect.

9. Reporting & audit

The template Id and TemplateGroupId values can be used by reporting processes to classify outbound emails by purpose (for example lead follow-up, billing, tax reminders, GDPR) by joining sent-email logs to template metadata, allowing analysis of follow-up efficiency and conversion.

Because many templates include deep links into BackOffice (for example @@URL_UPDATES@@), audit trails in those linked modules should record that the associated templated email was sent so Admin can reconcile communication history with billing and status changes.

10. Failure modes & alerts

If token substitution fails (for example missing @@INVOICE_NUMBER@@ or @@CLIENT_FULLNAME@@), resulting emails may be confusing or non-compliant, so the sending logic should validate required placeholders per template before sending, using the presence of tokens in Content as an implicit schema.

Templates that reference time-sensitive obligations or sanctions (for example account access restriction due to unpaid invoices, or statutory filing deadlines) amplify the impact of delivery failures, so any bulk job that uses them should expose logs or alerts for undeliverable messages.

11. Notifications catalogue

This section summarises key template categories, indicating typical trigger, recipients and automation level based solely on the CSV subjects and content.

  • Lead/contact notifications: “Urgent! Contact Client Reminder”, “Your Advocate Abroad Enquiry”, “Further Assistance Required?”, “An email was sent on your behalf”, and “Your Legal Enquiry - Advocate Abroad” manage initial contact, failed calls, reactivation and follow-up for Clients and Users.
  • Billing & account status: Templates around invoices, credit notes, receipts, and account restriction warnings target Users, with automatic and semi-automatic triggers tied to invoice due dates and payment status.
  • Tax and property communications: Property-owner and tax templates handle non-resident and resident tax compliance messaging and additional services offers, usually on scheduled yearly or quarterly cycles.
  • GDPR & compliance: Data access/deletion templates and the unsubscribe/legal footer implement regulatory communication obligations towards Clients and Users.
  • Internal guidance: Advice and strategy templates equip Users with sales and case-handling scripts that are not sent to clients but are still managed as templates for consistency and reuse.
  • Task & capability: Pending-task reminders and capability-blocking notices connect operational tasks to the ability of Users to continue receiving new enquiries.

12. Localisation & variants

CountryId and ProfessionId fields, combined with TypeCategoryId/TypeId where present, are used to create multiple variants of structurally similar messages, such as introductions and enquiry follow-ups tailored to architects, accountants, lawyers, translators and private detectives in different jurisdictions.

This approach allows the same trigger (for example “Enquiry inactive for X days”) to map to different template Ids depending on client country and service type, while maintaining consistent business logic and email structure.

13. Security & data protection

Templates that expose BackOffice URLs (for example @@URL_UPDATES@@, @@URL_CONSULTATION@@, @@URL_INVOICES_PENDING@@) are intended for authenticated Users, so any accidental use in Client-facing emails would risk leaking internal URLs, and must be prevented by strict mapping of which templates can be sent to each recipient role.

GDPR-related templates, and the requirement to include unsubscribe links in account-related messages, reinforce that template edits need review for compliance before deployment, especially when adding new placeholders or linking to external forms.

14. Admin Message Templates (overview only)

The CSV includes Admin-facing templates such as invoice preparation notices, access restriction messages, payment share notifications and internal guidance texts, whose purpose is to support Admin in monitoring performance, enforcing billing discipline, and coaching Users in case handling.

For Wiki purposes it is sufficient to record that this Admin template type exists, that new Admin templates are added by extending Template.csv (or the equivalent configuration store) with consistent group and subject naming, and that selection and triggering are implemented by Admin-only workflows rather than being exposed in client-facing UIs.

15. Open questions & gaps

  • The CSV does not specify the exact mapping between TemplateGroupId/TypeId values and concrete BackOffice/Laravel events, so separate documentation or code inspection is needed to complete a trigger-to-template matrix.
  • It is not clear from the CSV which templates are strictly automatic versus selectable by Users in the email editor; a UI-level description would be required to document the manual template selection process in detail.