Yes - I checked and used the documentation. The main differences from the example with my report are the use of a template, dbr.record and dbr.mail.recipient (vs a row value).
So the error I get is "Missing mail log procedure sp_emailsend_status parameters: inRowID,inRecipient"
The simplified format of my code is:
PROCEDURE `sp_DBR_template_hiring_email`(inRowID INT)
BEGIN
SELECT 'dbr.template', '#email_template', 'none';
SELECT 'dbr.record', 'begin';
SELECT e.fieldA AS FieldA,
e.fieldB AS FieldB,
e.fieldC AS FieldC,
e.fieldD AS FieldD,
e.rowid AS RowID,
e.recipient AS Recipient
FROM mytable e
WHERE e.rowid = inRowID;
SELECT 'dbr.record', 'end';
SELECT 'dbr.mail', 1;
SELECT 'dbr.mail.nobr.html', 1;
SELECT 'dbr.mail.recipient', 'name@myemail.com', 'Name of Recipient';
SELECT 'dbr.mail.log.proc', 'sp_emailsend_status', 'inRowID=RowID', 'inRecipient=Recipient';
END
Template
The template uses Fields A-D but not the last two.
The code of sp_emailsend_status is like:
PROCEDURE `sp_emailsend_status`(in_msg varchar(255), in_error text, in_to_address varchar(255), in_errornous_attachment_names varchar(255), inRowID INT, inRecipient varchar(100))
BEGIN
insert into dbr_email_log(sent_at, message, error, to_address, errornous_attachment_names, jobid, send_status)
values ( now(), in_msg, in_error, in_to_address , in_errornous_attachment_names, inJobID, IF(inSendStatus IS NULL, NOW(), inSendStatus));
END
Anything I am missing / have incorrect?