Class Mailer

java.lang.Object
org.nustaq.kontraktor.Actors
org.nustaq.kontraktor.Actor<Mailer>
org.nustaq.kontraktor.apputil.Mailer
All Implemented Interfaces:
Serializable, Executor, org.nustaq.kontraktor.monitoring.Monitorable

public class Mailer extends org.nustaq.kontraktor.Actor<Mailer>
Created by ruedi on 02/09/15. This helper actor can be used to send mails. Configuration is part of JuptrConfig
See Also:
  • Nested Class Summary

    Nested classes/interfaces inherited from class org.nustaq.kontraktor.Actor

    org.nustaq.kontraktor.Actor.ActorReport
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    static boolean
     

    Fields inherited from class org.nustaq.kontraktor.Actor

    __cbQueue, __clientConnection, __connections, __currentDispatcher, __mailbox, __mailboxCapacity, __mbCapacity, __publishTarget, __remoteId, __scheduler, __self, __stopped, __ticketMachine, connection, sender, userData, zzRoutingGCEnabled, zzServerMsgCallback

    Fields inherited from class org.nustaq.kontraktor.Actors

    CONT, DEFAULT_TIMOUT, defaultScheduler, delayedCalls, exec, instance, MAX_EXTERNAL_THREADS_POOL_SIZE, version
  • Constructor Summary

    Constructors
    Constructor
    Description
     
  • Method Summary

    Modifier and Type
    Method
    Description
    static String
    applyTemplate(String templateFileRelativeToTemplateDir, Map<String,?> data, BiFunction<String,Object,String> mapFun)
     
    static Mailer
    get()
     
    void
    init(MailCfg conf, String publicUrl)
     
    static void
    initSingleton(MailCfg settings, String publicUrl)
     
    org.nustaq.kontraktor.IPromise<Boolean>
    sendChannelMail(String channel, String receiver, String subject, String content)
     
    org.nustaq.kontraktor.IPromise<Boolean>
    sendDefaultMail(String receiver, String subject, String content)
     
    org.nustaq.kontraktor.IPromise<Boolean>
    sendEMail(String receiver, String subject, String content, String senderEmail, String displayName)
     
    org.nustaq.kontraktor.IPromise<Boolean>
    sendTemplateChannelMail(String channel, String receiver, String subject, String templateFile, Map<String,Object> data)
     
    void
     

    Methods inherited from class org.nustaq.kontraktor.Actor

    __addDeadLetter, __addRemoteConnection, __addStopHandler, __dispatchRemoteCall, __enqueueCall, __getCachedMethod, __removeRemoteConnection, __stop, __stopImpl, __submit, ask, askMsg, asyncstop, checkThread, close, closeCurrentClient, current, cyclic, debounce, delayed, execInThreadPool, execute, getActor, getActorRef, getCallbackSize, getConnections, getCurrentDispatcher, getFactory, getMailboxSize, getQSizes, getReport, getScheduler, getSubMonitorables, getUntypedRef, hasStopped, inside, inThread, isCallbackQPressured, isEmpty, isMailboxPressured, isProxy, isPublished, isRemote, isStopped, ping, router$clientPing, self, serialOn, setServerMsgCallback, stop, stopSafeClose, tell, tellMsg, unpublish, zzkrouterLostClient, zzRoutingRefGC

    Methods inherited from class org.nustaq.kontraktor.Actors

    AddDeadLetter, all, all, all, allMapped, AsActor, AsActor, AsActor, AsActor, AsUntypedActor, awaitAll, awaitAll, awaitAll, awaitAll, complete, complete, DeadLetters, flow, InThread, isComplete, isCont, isError, isErrorOrComplete, isResult, isTimeout, kYield, kYield, promise, race, race, reject, resolve, resolve, stream, SubmitDelayed, yieldCallbacks

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Field Details

    • DEBUG_MAIL

      public static boolean DEBUG_MAIL
  • Constructor Details

    • Mailer

      public Mailer()
  • Method Details

    • initSingleton

      public static void initSingleton(MailCfg settings, String publicUrl)
    • get

      public static Mailer get()
    • init

      public void init(MailCfg conf, String publicUrl)
    • updateSettings

      public void updateSettings(MailCfg conf)
    • applyTemplate

      public static String applyTemplate(String templateFileRelativeToTemplateDir, Map<String,?> data, BiFunction<String,Object,String> mapFun) throws IOException
      Throws:
      IOException
    • sendEMail

      public org.nustaq.kontraktor.IPromise<Boolean> sendEMail(String receiver, String subject, String content, String senderEmail, String displayName)
      Parameters:
      receiver - - the mail receiver
      subject - - subject of the mail
      content - - mail content
      senderEmail - - email adress from sender
      displayName - - display name shown instead of the sender email ..
      Returns:
      promise ..
    • sendDefaultMail

      public org.nustaq.kontraktor.IPromise<Boolean> sendDefaultMail(String receiver, String subject, String content)
      Parameters:
      receiver - - the mail receiver
      subject - - subject of the mail
      content - - mail content
      Returns:
      promise ..
    • sendChannelMail

      public org.nustaq.kontraktor.IPromise<Boolean> sendChannelMail(String channel, String receiver, String subject, String content)
    • sendTemplateChannelMail

      public org.nustaq.kontraktor.IPromise<Boolean> sendTemplateChannelMail(String channel, String receiver, String subject, String templateFile, Map<String,Object> data)