19 package org.turro.contacts.relation;
21 import java.util.logging.Level;
22 import java.util.logging.Logger;
23 import org.apache.commons.mail.EmailException;
24 import org.turro.action.MailSenders;
25 import org.turro.action.queue.NotificationCategory;
26 import org.turro.assistant.Assistant;
27 import org.turro.assistant.AssistantSet;
28 import org.turro.auth.Authentication;
29 import org.turro.contacts.BusinessRelation;
30 import org.turro.elephant.context.Application;
31 import org.turro.elephant.context.ElephantContext;
32 import org.turro.elephant.context.IConstructor;
33 import org.turro.i18n.I_;
34 import org.turro.mail.message.MailMessageTemplate;
35 import org.turro.mail.provider.MailProviders;
36 import org.turro.mail.queue.GenericElephantNotification;
37 import org.turro.mail.queue.QueueManager;
38 import org.turro.marker.ElephantMarker;
39 import org.turro.plugin.contacts.IContact;
58 addToQueue(
"relation-accepted",
I_.
get(
"Relation accepted"));
61 private void addToQueue(String
template, String reason) {
71 mmt.
addTo(assistant.email, assistant.name);
73 em.
put(
"notifier",
this);
75 mmt.
setMessage(em,
template, assistant.contact);
76 qm.
addToQueue(nc, assistant.contact, mmt, reason,
null);
78 }
catch (EmailException ex) {
91 return String.format(
"[%s] %s",
void addContact(IContact contact, Object relationEntity)
static IContact getIContact()
IConstructor getConstructor()
static Application getApplication()
static String get(String msg)
void setProcessLiveLinks(boolean processLiveLinks)
void setMessage(ElephantMarker marker, IContact contact)
static MailMessageTemplate of(MailProvider provider)
void setRoot(String root)
Email addTo(String email, String name)
void setSubject(String subject)
MailProvider getProvider(String name)
static MailProviders instance()
static final String GENERIC
static final String GENERIC_NOTIFICATION
NotificationCategory getCategory(String id)
MailItem addToQueue(NotificationCategory category, IContact contact, MailMessage mmt, String reason, String poolName)
boolean contactMayWant(IContact contact, String idCategory)
Object put(Object key, Object value)