For Zoho services only


I'm currently part of a wider delivery team at Ascent Business Solutions, recognised as a leading Zoho Premium Solutions Partner in the United Kingdom.

Ascent Business Solutions support organisations with everything from targeted technical fixes through to full Zoho CRM implementations and long-term platform adoption. Working as a team rather than a one-person consultancy allows projects to move forward consistently, with access to the right skills at each stage.

The team I manage specialises in API integrations between Zoho and third-party finance and commerce platforms such as Xero, Shopify, WooCommerce, and eBay. Much of our work involves solving integration challenges that fall outside standard documentation, supporting new ideas, new sectors, and evolving business models.

Success is measured through practical outcomes and return on investment, ranging from scaling small operations into high-turnover businesses to delivering rapid gains through online payments, automation, and streamlined digital workflows.

If you are looking for structured Zoho expertise backed by an established consultancy, you can contact Ascent Business Solutions on 0121 392 8140 (UK), email info@ascentbusiness.co.uk, or visit https://www.ascentbusiness.co.uk.
Zoho Creator: Sendmail a list of attachments

Zoho Creator: Sendmail a list of attachments

What?
This is a very quick article on sending an email with Deluge which needs a dynamic number of files attached to it.

Why?
This came up during a call with another developer and it occurred to me that perhaps this isn't clearly documented. But there are tips found across the web just not specifically addressing this.

How?
Here is the code for a test function which downloads 2 files from a public domain, no user wall. The key here which the official documentation is missing is the .setParamName() but for those who have spent time to find this function, they'll already know this.

copyraw
void fn_Joel_Test()
{
	/***
		- tried with getUrl() but this doesn't work.
		- has to be an invokeUrl
		- set param name required
		- if file comes from a Creator form, no InvokeURL needed
			c_Form = Form[ID == 1234]; 
			r_Download1 = c_Form.myFieldWithFile;
	***/
	l_Downloads = List();
	r_Download1 = invokeUrl
    [
    	url: "https://www.w3.org/WAI/ER/tests/xhtml/testfiles/resources/pdf/dummy.pdf"
    	type: GET
    ];
	r_Download1.setParamName("file");
	l_Downloads.add(r_Download1);
	r_Download2 = invokeUrl
    [
    	url: "https://www.africau.edu/images/default/sample.pdf"
    	type: GET
    ];
	r_Download2.setParamName("file");
	l_Downloads.add(r_Download2);
	//
	sendmail
    [
    	from: zoho.adminuserid
    	to: "This email address is being protected from spambots. You need JavaScript enabled to view it."
    	subject: "Test File: List"
    	message: "This is just a test"
		attachments: file: l_Downloads
    ]
}
  1.  void fn_Joel_Test() 
  2.  { 
  3.      /*** 
  4.          - tried with getUrl() but this doesn't work. 
  5.          - has to be an invokeUrl 
  6.          - set param name required 
  7.          - if file comes from a Creator form, no InvokeURL needed 
  8.              c_Form = Form[ID == 1234]
  9.              r_Download1 = c_Form.myFieldWithFile; 
  10.      ***/ 
  11.      l_Downloads = List()
  12.      r_Download1 = invokeUrl 
  13.      [ 
  14.          url: "https://www.w3.org/WAI/ER/tests/xhtml/testfiles/resources/pdf/dummy.pdf" 
  15.          type: GET 
  16.      ]
  17.      r_Download1.setParamName("file")
  18.      l_Downloads.add(r_Download1)
  19.      r_Download2 = invokeUrl 
  20.      [ 
  21.          url: "https://www.africau.edu/images/default/sample.pdf" 
  22.          type: GET 
  23.      ]
  24.      r_Download2.setParamName("file")
  25.      l_Downloads.add(r_Download2)
  26.      // 
  27.      sendmail 
  28.      [ 
  29.          from: zoho.adminuserid 
  30.          to: "This email address is being protected from spambots. You need JavaScript enabled to view it." 
  31.          subject: "Test File: List" 
  32.          message: "This is just a test" 
  33.          attachments: file: l_Downloads 
  34.      ] 
  35.  } 

Yields
Zoho Creator: Send mail a list of attachments: Result

Category: Zoho Creator :: Article: 385

Credit where Credit is Due:


Feel free to copy, redistribute and share this information. All that we ask is that you attribute credit and possibly even a link back to this website as it really helps in our search engine rankings.

Disclaimer: Please note that the information provided on this website is intended for informational purposes only and does not represent a warranty. The opinions expressed are those of the author only. We recommend testing any solutions in a development environment before implementing them in production. The articles are based on our good faith efforts and were current at the time of writing, reflecting our practical experience in a commercial setting.

Thank you for visiting and, as always, we hope this website was of some use to you!

Kind Regards,

Joel Lipman
www.joellipman.com