Hi,
I have made an integration where the result of a mapping is sent as an attachment within an email.
I would like to make the email address dynamic and set it in the main code of my mapping.
I have made this before using some standard xib functions and that works fine. However in this case mimeout mbc is between the mapping and the email send method to add the output of the mapping as an attachment. It looks like it that the email address I overrid in the main code gets lost in the mimeout MBS.
Anyone ideas why this does not work?
Thx, Rob
Here’s the code used.
# Override email recipient
$EmailOverrideSR.$Use_Recipient = TA_EMAIL.$True;
$EmailOverrideSR.$Recipient = $EmailRecipientSR;
# Pack the record.
$EmailOverrideStringSR = TA_EMAIL.PackSendMethodOverrideAttribute($EmailOverrideSR);
# Set email recipient
$EmailRecipientSetSR = SetEmailRecipient($EmailOverrideStringSR, $outputobjectSR);
# Override email subject in email with attachment
DECLARE FUNCTION SetEmailSubject($subject, $outputobject)
{
DECLARE $ret INTEGER;
DECLARE $thissubject STRING;
$ret=0;
$thissubject=$subject;
# There will be multiple output objects. However we will only set the email subject for the email with attachment
# The name of the output object is set to the name of the email output object as created in the datamapper (the adf)
FOR $i=1 TO ARRAYSIZE($outputObject)
{
DMU.GetOutputMessageIds $outputObject[$i]
SESSIONID $loc_sessionId
MESSAGEIDS $outmessageIds;
IF ARRAYSIZE($outmessageIds)<>0 {
FOR $i=1 TO ARRAYSIZE($outmessageIds) {
# Add an attribute to the output message.
MBC_HIERCHMSGENV.SetAttribute $loc_sessionId
MessageId $outmessageIds[$i]
NAME TA_EMAIL.$SendMethodOverrideAttribute
VALUE $thissubject;
}
$ret=1;
BREAK;
}
}
RETURN $ret;
}



