|
|
|
@ -88,9 +88,10 @@ public class InvitesManager {
|
|
|
|
|
InviteOperationResult result = null;
|
|
|
|
|
boolean emailResult = false;
|
|
|
|
|
try {
|
|
|
|
|
String vreName = aslSession.getGroupName();
|
|
|
|
|
result = store.saveInvite(invite);
|
|
|
|
|
emailResult = sendInviteEmail(request, aslSession, portalSenderEmail, portalURL, name, lastName, email, vreDescription);
|
|
|
|
|
notifyInviteSent(username, aslSession.getScopeName(), portalURL, PortalContext.getConfiguration().getGatewayName(), invite);
|
|
|
|
|
notifyInviteSent(username, aslSession.getScopeName(), portalURL, PortalContext.getConfiguration().getGatewayName(), invite, vreName);
|
|
|
|
|
|
|
|
|
|
} catch (AddressException e) {
|
|
|
|
|
_log.error("Email not valid " + e.getMessage());
|
|
|
|
@ -292,10 +293,9 @@ public class InvitesManager {
|
|
|
|
|
* @param scope .
|
|
|
|
|
* @param optionalMessage .
|
|
|
|
|
*/
|
|
|
|
|
public static void notifyInviteSent(String username, String scope, String portalbasicurl, String gatewayName, Invite invite) {
|
|
|
|
|
public static void notifyInviteSent(String username, String scope, String portalbasicurl, String gatewayName, Invite invite, String vreName) {
|
|
|
|
|
|
|
|
|
|
ArrayList<String> adminEmails = getAdministratorsEmails(scope);
|
|
|
|
|
|
|
|
|
|
StringBuffer body = new StringBuffer();
|
|
|
|
|
body.append("<p>Dear manager of "+ scope +",<br />this email message was automatically generated by " + portalbasicurl +" to inform you that ");
|
|
|
|
|
body.append("</p>");
|
|
|
|
@ -307,8 +307,7 @@ public class InvitesManager {
|
|
|
|
|
|
|
|
|
|
String[] allMails = new String[adminEmails.size()];
|
|
|
|
|
adminEmails.toArray(allMails);
|
|
|
|
|
EmailNotification mailToAdmin = new EmailNotification(allMails , "[" + gatewayName + "] - Sent Invitation", body.toString());
|
|
|
|
|
|
|
|
|
|
EmailNotification mailToAdmin = new EmailNotification(allMails , "An invite was sent on " + vreName + " by " + invite.getSenderFullName(), body.toString());
|
|
|
|
|
mailToAdmin.sendEmail();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|