Toggle menu
876
3.8K
30.2K
279.1K
Catglobe Wiki
Toggle preferences menu
Toggle personal menu
Not logged in
Your IP address will be publicly visible if you make any edits.

BulkMail sendSyncronious: Difference between revisions

From Catglobe Wiki
Nguyenduyan (talk | contribs)
No edit summary
Nguyenduyan (talk | contribs)
No edit summary
Line 24: Line 24:
</source>
</source>


<source lang="javascript">
<br><source lang="javascript">
number sent = BulkMail_sendSyncronious(bm[BULKMAIL_RESOURCE_ID], limit, function(number nrSending) {
number sent = BulkMail_sendSyncronious(bm[BULKMAIL_RESOURCE_ID], limit, function(number nrSending) {
//3400 == n mails, plus n*3 questions
//3400 == n mails, plus n*3 questions
Line 31: Line 31:
});
});
</source>
</source>
[[Category:Email_and_SMS_Functions]]

Revision as of 03:17, 25 November 2016


BulkMail_sendSyncronious

Send a bulk mail and return a number email have just sent.

Syntax

BulkMail_sendSyncronious(number BulkmailRId[,number MaxToSend][, callbackWithAmount]);

Arguments

BulkmailRId: Is a numeric (non-decimal) expression. It is the resource id of the bulk mail.
MaxToSend: Is a numeric (non-decimal) expression. It is the max email which send.
callbackWithAmount: any type

Return value

number

Examples

number a=BulkMail_sendSyncronious(15551353,1);
//result: 1


number sent = BulkMail_sendSyncronious(bm[BULKMAIL_RESOURCE_ID], limit, function(number nrSending) {
//3400 == n mails, plus n*3 questions
bool hasEnough = Workflow_syscall("CatglobeInABox_Payment_CheckMinAvailable", {companyResourceId, nrSending * 3400});
if (!hasEnough) throw stringReplace(_("OutOfUnits"), "{0}", nrSending * 3.4);
});