← 21. Email Template Module
Chunks — 21. Email Template Module
The FRD markdown is the source of truth; these chunks are the derived retrieval index used to give the test-case generator only the relevant slices. Rebuilt automatically when the FRD is saved.
42 chunks · ~5,513 tokens
#1
(intro)
~5 tok
Email Template Module
#2
(intro)
~1 tok
#
#3
(intro)
~1 tok
#
#4
(intro)
~53 tok
# **Email Template Module** **Functional Requirement Document** **BA & Ideation: Dakshraj Jhala** **Reviewed By: KG (Project Manager)** **Updated Date: 06 August 2025 Status: Approved** **Version 1.0**
#5
(intro)
~1 tok
#
#6
(intro)
~1 tok
#
#7
(intro)
~1 tok
#
#8
(intro)
~1 tok
#
#9
**Functional Requirements Document (FRD) - Email Template Module**
~17 tok
# **Functional Requirements Document (FRD) - Email Template Module**
#10
**Functional Requirements Document (FRD) - Email Template Module** > **1\. Module Overview**
~123 tok
## **1\. Module Overview** * **Module Name:** Email Template Management * **Purpose:** Enable users to create, manage, and publish reusable email templates with dynamic smart fields and attachments for use across all agency projects, events, and brands * **Business Goal:** Streamline email communication by providing standardized, branded email templates that automatically populate with project-specific smart fields data, improving efficiency and consistency in client communications
#11
**Functional Requirements Document (FRD) - Email Template Module** > **2\. User Roles & Permissions**
~69 tok
## **2\. User Roles & Permissions** **Role** **Description** **Key Permissions** Agency Admin System administrator for the agency Full access to create, edit, publish, delete, and manage all email templates Project Manager Agency team member Create and edit templates
#12
**Functional Requirements Document (FRD) - Email Template Module** > **3\. User Flow**
~5 tok
## **3\. User Flow**
#13
**Functional Requirements Document (FRD) - Email Template Module** > **3\. User Flow** > **Critical Path: Template Creation and Publishing**
~451 tok
### **Critical Path: Template Creation and Publishing**
1. **Template Access:** User navigates via Agency Portal → Templates Module → Email Templates sub-module
2. **Template Listing View:** View all published templates in a table format with search and sorting options
3. **Template Creation:** Click the "Create New" button to open the "Create an Email Template" pop-up
4. **Template Naming:** Enter template name (2-100 characters, mandatory)
5. **Template Design:** Click "Create Email" to open the template editor
6. **Content Creation:** Input subject line and email content using rich text editor
7. **Smart Fields Integration:** Add dynamic fields via the "Add Smart Fields" button, and also add the “Signature” smart field using the signature button option
8. **Attachment Management:** Add attachments from the library
9. **Template Testing:** Use "Test" functionality to send test emails
10. **Template Publishing:** Click "Publish" to make the template available agency-wide
11. **Template Management:** Edit, duplicate, or delete templates via kebab menu actions
12. **Template Usage:** Templates become available in email composition across all projects of all brands of the agency
1. Template Editing Flow:
1\. Access Edit Mode: User clicks "Edit" from kebab menu in template listing
2\. Editor Opens: Template editor opens with pre-populated fields (name, subject, body, attachments, smart fields)
3\. Make Changes: User modifies template content using the same editor interface as creation
4\. Validation: System validates template name uniqueness (excluding current template) and field requirements
5\. Publish Changes: User clicks "Publish" button to save changes
6\. Template Update: Updated template overwrites existing version and is immediately available#14
**Functional Requirements Document (FRD) - Email Template Module** > **3\. User Flow** > **Alternative Flows:**
~196 tok
### **Alternative Flows:**
* **Template Management:** Access template listing to view, search, and manage existing templates
* **Template Editing:** Edit existing published templates via the kebab menu (overwrites the current version)
* **Template Duplication:** Create copies of existing templates via the kebab menu
* **Template Deletion:** Delete templates with a confirmation dialog
* Empty State Flow:
* No Templates Exist: Display empty state with email icon, message "You have no email template yet", subtext "Would you like to create new email template?", and "Create New" button
* User Action: Clicking "Create New" opens the "Create an Email Template" pop-up
* Template Creation: User follows standard creation flow starting from template naming#15
**Functional Requirements Document (FRD) - Email Template Module** > **4\. Field Details & Validations**
~10 tok
## **4\. Field Details & Validations**
#16
**Functional Requirements Document (FRD) - Email Template Module** > **4\. Field Details & Validations** > **Email Templates Listing Fields**
~155 tok
### **Email Templates Listing Fields** **Field Name** **Type** **Required** **Validation Rules** \+ Create New Button N/A On click, it opens the Create an email template pop-up Search Templates Text Input No Search by template name only,case-insensitive, real-time filtering,no character limit Name Text + Icon Yes Display with email icon, sortable column Created Date Date Yes Display the date on which the template was created Actions Menu Kebab Menu N/A Edit, Duplicate, and Delete options Pagination Controls Dropdown + Navigation N/A 10, 15, 25 items per page, Default: 10 items per page.
#17
**Functional Requirements Document (FRD) - Email Template Module** > **4\. Field Details & Validations** > **Create an Email Template Pop-Up Fields**
~125 tok
### **Create an Email Template Pop-Up Fields** **Field Name** **Type** **Required** **Validation Rules** Email Template Name Text Input Yes 2-100 characters, must be unique within the agency Cancel Button N/A On click, it closes the pop-up Create Email Button Yes On click, if validation passes, it will open the template creation fields; otherwise, it will display a validation error Publish Button Yes Primary action button - saves and publishes template, updates Created date
#18
**Functional Requirements Document (FRD) - Email Template Module** > **4\. Field Details & Validations** > **Template Creation Fields**
~93 tok
### **Template Creation Fields** **Field Name** **Type** **Validation Rules** Subject Line Text Input 250 character limit Email Body Rich Text Editor Supports formatting, smart fields, and attachments 10,000 characters with a total message size limit of **15 MB** (attachments + body + headers). Ask AI Button On click, it will open a pop-up to write with AI
#19
**Functional Requirements Document (FRD) - Email Template Module** > **4\. Field Details & Validations** > **Rich Text Editor Features**
~72 tok
### **Rich Text Editor Features** **Feature** **Type** **Validation Rules** Undo/Redo Button Standard text formatting features Heading Styles Dropdown Bold/Italic/Underline Toggle Buttons Emoji Button Link Button Quote Button Bullet Points Button Numbered List Button
#20
**Functional Requirements Document (FRD) - Email Template Module** > **4\. Field Details & Validations** > **Smart Fields Integration**
~63 tok
### **Smart Fields Integration** **Field Name** **Type** **Validation Rules** Add Smart Fields Button Opens the smart field selection panel Smart Field Selection Multi-select Insert selected fields as dynamic smart fields, i.e., \[Field Name\]
#21
**Functional Requirements Document (FRD) - Email Template Module** > **4\. Field Details & Validations** > **Smart Field Available**
~42 tok
### **Smart Field Available** * **Link** - [Smart Fields Document](https://docs.google.com/document/d/14Uw-dJ_DIH_lJIh-vR2dBlaW3qj2eYjx9vZw4CHj_9s/edit?usp=sharing)
#22
**Functional Requirements Document (FRD) - Email Template Module** > **4\. Field Details & Validations** > **Attachment Management Fields**
~96 tok
### **Attachment Management Fields** * Field Details Reference - [**Click here**](https://docs.google.com/document/d/1tq7xa8OTj5gNNovmLEYj4pimsUWqhTT1J3svr4CSbz4/edit?tab=t.o31tcqr4r0rq#bookmark=id.k319556s5h9n) **Field Name** **Type** **Required** **Validation Rules** Clip Icon Button No Opens the attachment selection pop-up to attach images or documents from the library
#23
**Functional Requirements Document (FRD) - Email Template Module** > **4\. Field Details & Validations** > **Template Testing Fields**
~87 tok
### **Template Testing Fields** **Field Name** **Type** **Required** **Validation Rules** Test Button Button No Opens test email popup Test Email Address Email Input Yes Valid email format required Cancel Button N/A On click, it closes the send test pop-up Send Test Button Yes Sends the current template to the specified email
#24
**Functional Requirements Document (FRD) - Email Template Module** > **5\. Success Message Handling**
~122 tok
## **5\. Success Message Handling** **Validation Scenario** **Success Message** Template created and published successfully "Email template has been published successfully." Template updated successfully "Email template has been updated successfully." Test email sent successfully "Test email has been sent successfully." Template deleted successfully "Email template has been deleted successfully." Attachments added successfully "Attachments have been added successfully."
#25
**Functional Requirements Document (FRD) - Email Template Module** > **6\. Error Message Handling**
~381 tok
## **6\. Error Message Handling** **Field** **Validation Scenario** **Error Message** Email Template Name Empty submission "Please enter a template name." Email Template Name Length < 2 characters "Template name must be at least 2 characters." Email Template Name Length > 100 characters "Template name cannot exceed 100 characters." Email Template Name Duplicate name "A template with this name already exists." Test Email Address Empty submission "Please enter an email address." Test Email Address Invalid format "Please enter a valid email address." Attachment Selection No selection made "Please select at least one file to attach." Attachment Size Individual file exceeds 15MB "Individual attachment cannot exceed 15 MB." Template Navigation Unsaved changes "Your changes will not be saved. Are you sure you want to leave?" Smart Field Rendering Field data unavailable Display the smart field as \[Field Name\] without replacement Ask AI Pop-Up Keywords input field > 500 characters “Keywords cannot exceed 500 characters.” Template Search No results found "No templates found." General Server timeout "Something went wrong." Ask AI API timeout/rate limit/network failure "Something went wrong." Subject Line Length > 250 characters "Subject line cannot exceed 250 characters." Email Body Length > 10,000 characters "Email body cannot exceed 10,000 characters." Total Message Size Attachments + body + headers exceed 15 MB "Total message size cannot exceed 15 MB."
#26
**Functional Requirements Document (FRD) - Email Template Module** > **7\. Functional Logic**
~7 tok
## **7\. Functional Logic**
#27
**Functional Requirements Document (FRD) - Email Template Module** > **7\. Functional Logic** > **Template Creation and Impact**
~129 tok
### **Template Creation and Impact**
* Templates are automatically published upon clicking the Publish button (no draft state)
* Unsaved changes are lost if the user navigates away without publishing
* Templates will be used in the following modules:
* **Email** **Thread (Project email centre, client communication tab)**
* **Contracts**
* **Proposals**
* **Contractor’s service agreement**
* **Questionnaires**
* **Invoices**
* **Lead Form**
* **Automation**#28
**Functional Requirements Document (FRD) - Email Template Module** > **7\. Functional Logic** > **Template Management Logic (Email Templates Listing)**
~101 tok
### **Template Management Logic (Email Templates Listing)**
* Only created templates are displayed in the template listing view in the email composition
* When a user selects a template to send an email, they can make changes to the content of the email. These changes will only apply to the email the user is sending and will not affect the original template. The template will remain unchanged#29
**Functional Requirements Document (FRD) - Email Template Module** > **7\. Functional Logic** > **Template Deletion**
~254 tok
### **Template Deletion**
* Before allowing the deletion of a template, the system will first check if the template is being used in any module, such as automation
* **If the template is not used in another module:**
* If the template is not being used anywhere, the system will prompt a confirmation dialog, and on confirmation, the template will be deleted permanently
* **If the template is used in any other module:**
* If the template is being used in automation or any other module, a warning pop-up will appear. The pop-up message will inform the user that they must remove the template from the specific module (e.g., automation) before the template can be deleted. Message:
* "The template is currently being used in \[Module Name\]. Please remove it from the module before deleting it."
* Deleted templates are permanently removed from the agency’s all brands and become unavailable in the email composition template dropdown, and will not affect the existing already sent emails#30
**Functional Requirements Document (FRD) - Email Template Module** > **7\. Functional Logic** > **Smart Field Processing Logic**
~131 tok
### **Smart Field Processing Logic**
* Smart fields are stored as a dynamic smart field, i.e., \[Field Name\] in template content
* During email composition, smart fields are replaced with actual project data
* Smart fields pull data from the current project context
* Primary client data is used in the client's smart field when multiple clients exist:
* Use client marked as "Primary Client" in project settings
* If no primary client is designated, use the client with the oldest created\_at timestamp#31
**Functional Requirements Document (FRD) - Email Template Module** > **7\. Functional Logic** > **Signature Logic**
~117 tok
### **Signature Logic** * If an email template contains a smart field for the signature, the system will automatically fetch the brand-specific signature for the user. The signature will be based on the user who is sending the email * For example, if a team member is part of a project under a specific brand, their **brand-specific email signature** will be fetched in the email when using the template, ensuring that the correct signature for the brand is shown
#32
**Functional Requirements Document (FRD) - Email Template Module** > **7\. Functional Logic** > **Attachment Logic**
~629 tok
### **Attachment Logic**
* Attachments are sourced exclusively from the agency library
* The library contains two categories: Images and Documents
* Attachment Logic:
* Attachments are sourced exclusively from the agency library
* The library contains two categories: Images and Documents
* Attachment Size Logic:
* Each individual attachment can be up to 15 MB
* Attachments are stored on the Pixally server and converted to links within the email
* Because files are served as links rather than embedded directly, multiple attachments can be included without exceeding the email's payload size limit
* The total email size limit remains 15 MB
* Since attachments are link-based, this limit applies to the overall email payload (body content, inline assets, etc.) and not to the referenced attachment files
* If an individual file exceeds 15 MB during upload, the system will prevent the upload and display an error message
* Total Message Size Logic:
* The total message size limit is 15 MB, which includes: attachments (converted to links) + email body content + email headers
* Attachments are stored as links on the Pixally server, so the link reference (not the file size) counts toward the message size
* Email body content (including formatting, smart fields placeholders, and inline elements) counts toward the message size
* Email headers (metadata, recipient information, subject line) count toward the message size
* If the total message size exceeds 15 MB during composition or sending, the system will prevent sending and display an error message
* Attachment Persistence in Email Template: If a file is attached to an email template from the library (e.g., an image or document), and the file is later deleted from the library, the attachment will persist in the email template
* Selected attachments are embedded in the template and inherited during email composition
* Multiple attachments can be selected from both categories (Images/documents)
* Attachment Persistence in Email Template: If a file is attached to an email template from the library (e.g., an image or document), and the file is later deleted from the library, the attachment will persist in the email template
* Selected attachments are embedded in the template and inherited during email composition
* Multiple attachments can be selected from both categories (Images/documents)#33
**Functional Requirements Document (FRD) - Email Template Module** > **7\. Functional Logic** > **Template Publishing Logic**
~99 tok
### **Template Publishing Logic** * Templates are automatically published and available immediately after creation * Templates are agency-wide and available across all brands and projects of the agency * Published templates can be **edited** via the kebab menu in the email template listing (overwriting the existing version), and updated templates will only appear in future template use
#34
**Functional Requirements Document (FRD) - Email Template Module** > **7\. Functional Logic** >
~1 tok
###
#35
**Functional Requirements Document (FRD) - Email Template Module** > **7\. Functional Logic** > **Duplicate Template Logic**
~110 tok
### **Duplicate Template Logic** * Duplicate Template Logic: When the "Duplicate" action is selected, a copy of the template will be created with the name **"Copy of \[original template name\]"** * This duplicate template will function just like the original, allowing users to perform any actions on it. It will be added to the list as a new template, so users can modify or use it independently without affecting the original template
#36
**Functional Requirements Document (FRD) - Email Template Module** > **7\. Functional Logic** > **Template Testing Logic**
~79 tok
### **Template Testing Logic** * Test functionality sends template with current content and formatting * Smart fields in test emails display as \[Field Name\], as it is not project-specific and only for testing purposes * Test emails include any attached files * No limitations on the number of test emails
#37
**Functional Requirements Document (FRD) - Email Template Module** > **7\. Functional Logic** > **Ask AI Logic**
~501 tok
### **Ask AI Logic**
**AI Content Generation Process**
* User clicks "Ask AI" button to open "Craft Your Email with AI Assistance" pop-up
* AI assistance is exclusively for email body content generation, not the subject line
* User enters a prompt in the Keywords text area **(500-character limit)**
* User clicks "Generate" to initiate AI content creation (it will use the OpenAI third-party API internally)
* Generated content appears in a read-only preview area with proper formatting
* AI-generated content does not include smart field integration or placeholders
* On clicking the Close (X) button, the pop-up will close, and no changes will be made to the email template body
* API Error Handling: If API timeout, rate limit, or network failure occurs, display error message: "Something went wrong."
**Content Modification Options**
* **Make It Shorter:** Automatically regenerates a summarised version of the current content
* **Make It Longer:** Automatically regenerates an expanded version of the current content
* All modification buttons trigger new API calls
**Content Integration Logic**
* **Keep Button: -** If email body already contains content, display confirmation dialog: "This will replace all existing content. Continue?" with "Replace" and "Cancel" buttons - On "Replace": The entire email body content is replaced with the generated content, maintaining the formatting shown in the pop-up's preview - On "Cancel": Dialog closes, no changes made - If email body is empty, clicking "Keep" directly replaces content without confirmation
* Users cannot edit the generated content in the pop-up preview area - it is read-only
* The user can only edit in the keywords input field
* The generated content is inserted into the email template body with the same formatting as shown in the preview area, and the user can modify it directly in the template
* **Try Again Button:** Allows users to modify their prompt and regenerate content#38
**Functional Requirements Document (FRD) - Email Template Module** > **8\. Edge Cases**
~171 tok
## **8\. Edge Cases** **Scenario** **Expected Behavior** User navigates away without publishing Display warning: "Your changes will not be saved. Are you sure you want to leave?" The template name already exists Show error message and prevent creation Template with no subject line Allow publishing (subject is optional) Template with empty body Allow publishing (body is optional) The template listing page loads with no templates Show empty state with "Create New" button Multiple clients in the project Use primary client data for client-related smart fields Library images/documents deleted after template creation It will remain in the attachment of the template
#39
**Functional Requirements Document (FRD) - Email Template Module** > **9\. Test Cases**
~9 tok
## **9\. Test Cases** * **Link:**
#40
**Functional Requirements Document (FRD) - Email Template Module** > **10\. Acceptance Criteria**
~768 tok
## **10\. Acceptance Criteria** * The user can create, edit, duplicate, and preview email templates * Templates support rich text formatting with standard editor features * Smart fields automatically populate with project-specific data during email composition using \[Field Name\] format * Published templates are available agency-wide across all brands and projects of the agency * Test functionality allows sending preview emails to specified email addresses * The template listing displays all created templates with search functionality, sorting, and pagination * Template deletion includes usage checking across modules with appropriate warning messages * Template duplication creates a copy of the template with the name "Copy of \[original template name\]" * Signature smart field displays a brand-specific signature based on the user within the selected brand's project * Attachment persistence ensures files remain in the template even if deleted from the library * Users can modify template content during email composition without affecting the original template * Navigation warning displays when leaving the template editor without publishing * Individual attachment size validation prevents files exceeding 15 MB from being uploaded * Multiple attachments are supported via link-based storage, with total email payload limit of 15 MB * AI-generated content replaces the entire email body and maintains formatting as displayed in the preview * **"Ask AI"** button is available in the email and on click opens the “Craft your email with AI assistance” pop-up * **AI Content Generation:** Users can enter prompts up to 500 characters and generate email content via the OpenAI API * **AI Content Modification:** Generated content can be modified using tone change, make shorter, or make longer options * **AI Content Integration:** Users can keep AI-generated content with a confirmation pop-up, replacing the entire email body * **AI Content Preview:** Generated content is displayed in read-only view * **AI Prompt Editing:** Users can modify their prompts and regenerate content using the "Try Again" functionality * **AI Content Formatting:** AI-generated content maintains formatting consistency when integrated into an email template * Template editing updates "Created" date and overwrites existing version immediately * Search functionality filters templates by name only, case-insensitive, with real-time results * Primary client selection follows defined hierarchy: designated primary → oldest created\_at * Empty state displays with appropriate messaging and "Create New" call-to-action * Search input field has no character limit for template name searches * Subject line validation enforces 250 character maximum limit * Email body validation enforces 10,000 character maximum limit * Total message size validation prevents sending when combined size (attachments + body + headers) exceeds 15 MB * Character count indicators display for subject line and email body approaching limits
#41
**Functional Requirements Document (FRD) - Email Template Module** > **11\. Dependencies**
~195 tok
## **11\. Dependencies** **Module/System** **Dependency Type** **Impact if Unavailable** Project Management Module Data Dependency Smart fields cannot populate project-specific data Agency Settings Module Data Dependency Agency-related smart fields unavailable Brand Settings Module Data Dependency Brand-specific smart fields unavailable Library Management Module Service Dependency Cannot attach files to templates Email Composition Module Integration Dependency Templates cannot be used in email sending Automation Module Integration Dependency Cannot use templates in automated email workflows User Authentication Service Dependency Cannot verify Agency Admin permissions Rich Text Editor Component Component Dependency Cannot format template content
#42
**Functional Requirements Document (FRD) - Email Template Module** > **12\. References**
~41 tok
## **12\. References** * **Figma Link**: [**Click Here**](https://www.figma.com/design/ej0kxwP45mDKmZCZfAJ5O8/Pixally?node-id=25816-47618&t=bRA26daPq6Tt2RAs-0)