Hey developers, I would like to send an email to a client if their balance reaches a limit. How can I do that? Is it possible to set a condition on the balance in the interface definition and then trigger a process model that sends the email?
a!localVariables( local!emailSent, local!button :false(), a!sectionLayout( label: "", labelColor: "#000", contents: { if( ri!account['recordType!{b37748b2-8103-41ea-8028-2b358e4f229c}PBY account.fields.{4a9de4b2-f127-44f1-86d2-21c2a6b2ee2d}Solde'] > 20000000, {}, { a!buttonLayout( a!buttonWidget( label: "Voir détails", value: true, saveInto: { local!button, a!startProcess( processModel: cons!PBY_sendEmail, processParameters: { account: ri!account, }, onSuccess: a!save(local!emailSent, true), onError: a!save(local!emailSent, false) ), }, submit: true, style: "OUTLINE", validate: false ), ), if(local!button = true(),{ a!cardLayout( showBorder: true, padding: "STANDARD", showShadow : true, shape: "ROUNDED", decorativeBarPosition:"TOP", decorativeBarColor:"#BF0519", contents: { a!richTextDisplayField( value: { a!richTextItem( style: "STRONG", color: "#BF0519", size: "LARGE", text: "Le solde de votre compte est inférieur à 20000000. Veuillez réapprovisionner votre compte s'il vous plaît." ), } ), a!richTextDisplayField( value: { a!richTextItem( text: "Cliquer ici pour reaprovisionner votre compte!" ) } ), a!recordActionField( actions: { a!recordActionItem( action: 'recordType!{b37748b2-8103-41ea-8028-2b358e4f229c}PBY account.actions.{33799d70-2d16-45b1-b734-37f69153501c}Reaprévisionner', ) } ) }, ), }, {} ), /*a!richTextDisplayField(*/ /*value: {*/ /*a!richTextItem(*/ /*style: "STRONG",*/ /*color: "#BF0519",*/ /*backgroundColor: "#BF0519",*/ /*size: "LARGE",*/ /*text: "Le solde de votre compte est inférieur à 20000000. Veuillez réapprovisionner votre compte s'il vous plaît."*/ /*)*/ /*}*/ /*)*/ } ) } ) } ),
Discussion posts and replies are publicly visible
Hi hrshkar,
You can build a scheduler process which will check the client balance and if it meets the condition then it will send an email. You can keep the frequency as 1 hour or can adjust according to your need. Keep data management policy delete 1 day or less.
Yes, I'm with Harsh. a scheduler which would run a expression rule in a script to return all the email addresses and the balance respectively if they are below the threshold and use the email template to keep the Threshold amount if needed. Use the email addresses returned from the output as the recipient. You either run this as Harsh mentioned on Hour and if its not something crucial in hourly basis I recommend running it with a 24hr interval.If you want this to be an action where the Manager or the supervisor sends the notification on demand, then have a related action and its Action visibility configured in the record actions visibility configuration against the Amount as the threshold.