No Ability to Rename Record Template PDFs in SendMail Task

No Ability to Rename Record Template PDFs in SendMail Task

As highlighted previously in this post, we still have to deal with the limitation of not being able to rename a record template when sent as a PDF using the SendMail Task. This creates unnecessary complexity for what should be a simple operation, and I'm hoping the Zoho team can address this in a future update. 

The Issue According to the official SendMail documentation, you can attach Record Templates as PDFs using the following syntax:
sendmail
[
    from: zoho.adminuserid
    to: input.customer_email
    subject: "Invoice"
    message: "Please find your invoice attached"
    Attachments: template:Invoice_Template:Form_Name record_id as PDF
]
However, the PDF filename is automatically generated based on the template name and cannot be customized or renamed programmatically. This creates unnecessary complexity for what should be a simple operation, and I'm hoping the Zoho team can address this in a future update. The Issue According to the official SendMail documentation, you can attach Record Templates as PDFs using the following syntax:
sendmail
[
    from: zoho.adminuserid
    to: input.customer_email
    subject: "Invoice"
    message: "Please find your invoice attached"
    Attachments: template:Invoice_Template:Form_Name record_id as PDF
]
However, the PDF filename is automatically generated based on the template name and cannot be customized or renamed programmatically. The Problem When clients require specific PDF naming conventions (e.g., "ClientName_Invoice_2024.pdf" instead of "Invoice_Template.pdf"), there is no straightforward solution.
Workaround Approach Implementation Problems Status
Manual Export User exports PDF manually and uploads to file field - Not acceptable for automated workflows
- Defeats purpose of automation
- Poor user experience
✗ Not viable for production
Email-to-Form API Send PDF to another form, fetch via GET API, rename, then send - Does NOT work "On Add → On Success"
- Timing/race condition issues
- Only works manually updating record
- Requires additional forms and complexity
✗ Unreliable without delays
Scheduled Workaround Use scheduled task to trigger GET request and rename - Introduces unnecessary delays
- Overcomplicated for simple task
- Requires schedule management
⚠ Works but highly inefficient
Example of Current Complexity To accomplish what should be a simple filename rename, developers must implement this convoluted workaround:
// STEP 1: Send PDF to intermediate form via email
sendmail
[
    from: zoho.adminuserid
    to: "capture_form@creator.zoho.com"
    subject: "Temp PDF"
    Attachments: template:Invoice_Template:Form_Name record_id as PDF
]

// STEP 2: Schedule a task (not immediate!)
// Wait for email to process...

// STEP 3: Fetch the file via API
file_response = invokeUrl
[
    url: api_endpoint
    type: GET
    connection: "creator_connection"
];

// STEP 4: Rename using setFileName
file_response.setFileName("CustomFileName.pdf");

// STEP 5: Finally send with renamed file
sendmail
[
    from: zoho.adminuserid
    to: input.customer_email
    subject: "Invoice"
    Attachments: file:file_response
]
This entire process requires:
  • Additional form creation
  • API connection setup
  • Schedule configuration
  • Complex error handling
What Should Happen Instead
Proposed Solution: Add a simple filename parameter to the SendMail attachment syntax:
sendmail
[
    from: zoho.adminuserid
    to: input.customer_email
    subject: "Invoice"
    Attachments: template:Invoice_Template:Form_Name record_id as PDF filename:"Custom_Name.pdf"
]
Or allow variable-based naming:
pdf_name = input.Client_Name + "_Invoice_" + input.Invoice_Number + ".pdf";

sendmail
[
    from: zoho.adminuserid
    to: input.customer_email
    subject: "Invoice"
    Attachments: template:Invoice_Template:Form_Name record_id as PDF filename:pdf_name
]
This single parameter would eliminate hours of workaround development and make PDF naming consistent with client requirements.
Real-World Impact
This limitation affects any business process requiring:
  • Branded invoices with client-specific naming conventions
  • Compliance documents with standardized filename formats (e.g., "CompanyName_ISO_Certificate_2024.pdf")
  • Automated reports sent to clients who need predictable filenames for their filing systems
  • Quote/proposal systems where filename needs to include reference numbers
  • Any professional service where PDF naming impacts client experience

Developer Impact: What should take 30 seconds (adding a filename parameter) instead requires hours of workaround implementation, creating technical debt and maintenance overhead.

Request to Zoho Team

Can this be addressed in a future update?

This is a frequently requested feature that impacts professional presentation and client satisfaction. The current implementation forces developers to choose between:

1. Default Naming
Accept generic template-based filenames that don't meet client requirements
2. Complex Workarounds
Spend hours implementing unreliable solutions with scheduled tasks and API calls

We shouldn't have to make this choice for such a basic requirement.

Community Input Requested: Has anyone else encountered this limitation or found a more reliable workaround? This has been an ongoing frustration, and I know many developers would benefit from a native solution.


📚 Documentation References: