mirror of
https://github.com/Alfresco/alfresco-community-repo.git
synced 2025-08-07 17:49:17 +00:00
Merged BRANCHES/DEV/V3.4-BUG-FIX to HEAD:
28414: Merged BRANCHES/V3.4-TEAM to BRANCHES/DEV/V3.4-BUG-FIX: 28343: Fix for Team issue where a failure to send an invite email will abort the whole invite process i.e. an outbound email server HAS to be setup for invites to work. 28400: L10N strings for Fix to: ALF-5917 (accompanies the code in rev 28343) git-svn-id: https://svn.alfresco.com/repos/alfresco-enterprise/alfresco/HEAD/root@28415 c4b6b30b-aa2e-2d43-bbcb-ca4b014f7261
This commit is contained in:
@@ -80,6 +80,7 @@ public class MailActionExecuter extends ActionExecuterAbstractBase
|
||||
public static final String PARAM_FROM = "from";
|
||||
public static final String PARAM_TEMPLATE = "template";
|
||||
public static final String PARAM_TEMPLATE_MODEL = "template_model";
|
||||
public static final String PARAM_IGNORE_SEND_FAILURE = "ignore_send_failure";
|
||||
|
||||
/**
|
||||
* From address
|
||||
@@ -533,9 +534,15 @@ public class MailActionExecuter extends ActionExecuterAbstractBase
|
||||
}
|
||||
}
|
||||
|
||||
// always log the failure
|
||||
logger.error("Failed to send email to " + to, e);
|
||||
|
||||
throw new AlfrescoRuntimeException("Failed to send email to:" + to, e);
|
||||
// optionally ignore the throwing of the exception
|
||||
Boolean ignoreError = (Boolean)ruleAction.getParameterValue(PARAM_IGNORE_SEND_FAILURE);
|
||||
if (ignoreError == null || ignoreError.booleanValue() == false)
|
||||
{
|
||||
throw new AlfrescoRuntimeException("Failed to send email to:" + to, e);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -630,6 +637,7 @@ public class MailActionExecuter extends ActionExecuterAbstractBase
|
||||
paramList.add(new ParameterDefinitionImpl(PARAM_FROM, DataTypeDefinition.TEXT, false, getParamDisplayLabel(PARAM_FROM)));
|
||||
paramList.add(new ParameterDefinitionImpl(PARAM_TEMPLATE, DataTypeDefinition.NODE_REF, false, getParamDisplayLabel(PARAM_TEMPLATE), false, "ac-email-templates"));
|
||||
paramList.add(new ParameterDefinitionImpl(PARAM_TEMPLATE_MODEL, DataTypeDefinition.ANY, false, getParamDisplayLabel(PARAM_TEMPLATE_MODEL), true));
|
||||
paramList.add(new ParameterDefinitionImpl(PARAM_IGNORE_SEND_FAILURE, DataTypeDefinition.BOOLEAN, false, getParamDisplayLabel(PARAM_IGNORE_SEND_FAILURE)));
|
||||
}
|
||||
|
||||
public void setTestMode(boolean testMode)
|
||||
|
@@ -133,6 +133,7 @@ public class InviteSender
|
||||
mail.setParameterValue(MailActionExecuter.PARAM_TEMPLATE, getEmailTemplateNodeRef());
|
||||
mail.setParameterValue(MailActionExecuter.PARAM_TEMPLATE_MODEL,
|
||||
(Serializable)buildMailTextModel(properties, inviter, invitee));
|
||||
mail.setParameterValue(MailActionExecuter.PARAM_IGNORE_SEND_FAILURE, true);
|
||||
actionService.executeAction(mail, getWorkflowPackage(properties));
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user