Can be easily done by adding one additional call while submitting the report.
Problem is that to send an email you need to make SMTP call to an email server usually done via web service or proxy service or Amazon SES with API gateway or Google cloud functions or some other provider like Zapier to help you send emails. QML/AppStudio does not have native support to make SMTP calls directly (not recommended either). Once you have this established you can call this web endpoint while submitting the report with any information you want.
For example: Here is a link showing how PHP developers would do it: PHP: mail - Manual
Once you have an url that can help you send email to your clients you can call this from the Quick Report app using NetworkRequest object.
File: FeatureServiceManager.qml (under controls folder)
1. Create a NetworkRequest object to call the webservice url to send an email
NetworkRequest {
id: emailHandler
url: "<your http link to webservice>"
method: "POST"
onReadyStateChanged: {
if (readyState === NetworkRequest.DONE ){
if (errorCode!=0) {
console.log("Network error!");
//do something, may be retry later
} else {
//success.
}
}
}
function sendEmail(recipients, heading, body) {
var obj = {};
obj.emailRecipients = recipients.toString();
obj.emailHeading = heading.toString();
obj.emailBody = body.toString();
send(obj)
}
}
2. Call this new emailHandler when submitting report inside of the "applyEdits" function at the end.
Hope this helps.