Giter Club home page Giter Club logo

play-mailer's People

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

play-mailer's Issues

Support for cid

I'm trying to generate an email with inline image. Based on my tests, it seems that there is no way to define cid (it's not included in generated mail) for an inline attachment.

Can you please verify?

Change the documentation format

Currently the documentation format is in Ascii Doc I don't think that is suitable anymore.
I would like to propose a switch to either Markdown or RST

Retrieve the latest configuration before sending an email

Hello, currently we have something like that:

class SMTPMailer @Inject() (smtpConfiguration: SMTPConfiguration) extends MailerClient {

However the Provider doesn't help here since the SMTPMailer will just do the same as before.

Currently it would be great if SMTPMailer stays the same so that we contain compability, however for the injection point it would be better to have something like:

class ConfigurableMailer @Inject()(smtpConfigurationProvider: Provider[SMTPConfiguration]) extends MailerClient {

  override def send(data: Email): String = {
    new SMTPMailer(smtpConfigurationProvider.get()).send(data)
  }

}

If we don't the Provider makes just no sense.

What package should the MailerPlugin be located in?

The sample application included fails to compile because it's looking for MailerPlugin inside play.api.libs.mailer. On inspection of the latest 2.3.1 release, it appears to still be located within the com.typesafe.plugin namespace.

The namespace changes on github don't appear to be reflected in the published jar.

No Support for Compile Time DI with Play 2.4

Hi,
Play 2.4 supports both runtime and compile time dependency injection.
As CommonsMailer uses @Inject it seems impossible to use it without the Guice container.
It would be nice to provide a trait that provide a "raw" mailer client and that could be mixed in Play's BuiltInComponentsFromContext to support compile time DI, like this WS Component for example.

Thanks

Loïc

Move mailer into its own package

Currently the package of the mailer is com.typesafe.plugins. It should probably be play.libs.mailer for Java and play.api.libs.mailer for Scala.

PlayConfig.getOptional has been removed from PlayFramework in Master branch

Hi,

The Play Mailer project is using 2.4.2 right now which should not have any issues, but I just wanted to note that in the Play Framework Master branch things have changed that would cause PlayConfig to break if run against Play Master instead of 2.4.2.
This pull request: playframework/playframework#4588 has removed the getOptional calls that are used by MailerPlugin.scala (See: https://github.com/playframework/play-mailer/blob/35358de784cae2158d12579d0283b10a28dcb0a3/src/main/scala/play/api/libs/mailer/MailerPlugin.scala)

As such, at some point you will probably want to adjust the Play Mailer plugin accoringly.

Thanks,

-Sean

Socket timeouts

Hi,

Is it possible to configure the connect and I/O timeouts?

I (think) that I can see that they are not configurable as plugin settings, but I am not sure whether it is possible to configure the underlying javax.mail session directly.

Setting mail.smtp.timeout and mail.smtp.connectiontimeout as system properties has no effect since commons-email's org.apache.commons.mail.Email has a default timeout greater than zero (EmailConstants.SOCKET_TIMEOUT_MS) and that will be used instead (lines 678 -> 687).

If I am not mistaken and the plugin does not currently support configuring those options, do you think that support should be added?

Thanks,
-Dan

play.mailer configuration does not work

I am using play-mailer 3.0.0-RC1 with play 2.4.0 java.

When I start my app I have a warning that tolds me to use the new syntax for configuration

But with this new syntax I have an exception java.lang.RuntimeException: play.mailer.host needs to be set in application.conf in order to use this plugin (or set play.mailer.mock to true)

Configuration that works

smtp {
  host = "mailtrap.io"
  port = 2525
  tls = true
  user = "xxx"
  password = "xxx"
}

Configuration that does not work

play {
  mailer {
    host = "mailtrap.io"
    port = 2525
    tls = true
    user = "xxx"
    password = "xxx"
  }
}

object mailer is not a member of package play.api.libs

There is an issue with using "com.typesafe.play.plugins" %% "play-plugins-mailer" % "2.3.1"
as described here [https://github.com/playframework/play-mailer/blob/master/README.md].

Take a look at contents of [http://repo.typesafe.com/typesafe/releases/com/typesafe/play/plugins/play-plugins-mailer_2.11/2.3.1/play-plugins-mailer_2.11-2.3.1.jar]

[09:05:29] skierat ~/Downloads jar tvf play-plugins-mailer_2.11-2.3.1.jar 
   323 Fri Oct 24 08:39:06 CEST 2014 META-INF/MANIFEST.MF
     0 Fri Oct 24 08:39:06 CEST 2014 com/
     0 Fri Oct 24 08:39:06 CEST 2014 com/typesafe/
     0 Fri Oct 24 08:39:06 CEST 2014 com/typesafe/plugin/
   507 Fri Oct 24 08:39:04 CEST 2014 com/typesafe/plugin/MailerPlugin.class
  3228 Fri Oct 24 08:39:04 CEST 2014 com/typesafe/plugin/MailerBuilder$Attachment$.class
  1092 Fri Oct 24 08:39:04 CEST 2014 com/typesafe/plugin/MockMailer$$anonfun$send$19.class
  2163 Fri Oct 24 08:39:04 CEST 2014 com/typesafe/plugin/CommonsMailer$$anonfun$send$8$$anonfun$apply$6.class
  1668 Fri Oct 24 08:39:04 CEST 2014 com/typesafe/plugin/CommonsMailer$$anonfun$send$9.class
  6268 Fri Oct 24 08:39:04 CEST 2014 com/typesafe/plugin/MailerBuilder.class
  5403 Fri Oct 24 08:39:04 CEST 2014 com/typesafe/plugin/MockMailer.class
  1581 Fri Oct 24 08:39:04 CEST 2014 com/typesafe/plugin/CommonsMailer$$anonfun$send$4.class
  1186 Fri Oct 24 08:39:04 CEST 2014 com/typesafe/plugin/MailerAPI.class
  1009 Fri Oct 24 08:39:04 CEST 2014 com/typesafe/plugin/CommonsMailerPlugin$$anonfun$3.class
  1316 Fri Oct 24 08:39:04 CEST 2014 com/typesafe/plugin/MockMailer$$anonfun$send$12.class
  1318 Fri Oct 24 08:39:04 CEST 2014 com/typesafe/plugin/MockMailer$$anonfun$send$17.class
  1319 Fri Oct 24 08:39:04 CEST 2014 com/typesafe/plugin/MockMailer$$anonfun$send$13.class
  1522 Fri Oct 24 08:39:04 CEST 2014 com/typesafe/plugin/MockMailer$$anonfun$send$18.class
   927 Fri Oct 24 08:39:04 CEST 2014 com/typesafe/plugin/CommonsMailer$$anonfun$send$1.class
  1054 Fri Oct 24 08:39:04 CEST 2014 com/typesafe/plugin/CommonsMailer$$anonfun$send$8$$anonfun$7.class
  1238 Fri Oct 24 08:39:04 CEST 2014 com/typesafe/plugin/MockMailer$$anonfun$send$14$$anonfun$apply$13.class
  1618 Fri Oct 24 08:39:04 CEST 2014 com/typesafe/plugin/CommonsMailer$$anonfun$send$9$$anonfun$apply$9.class
  1319 Fri Oct 24 08:39:04 CEST 2014 com/typesafe/plugin/MockMailer$$anonfun$send$11.class
  4893 Fri Oct 24 08:39:04 CEST 2014 com/typesafe/plugin/CommonsMailerPlugin.class
  1581 Fri Oct 24 08:39:04 CEST 2014 com/typesafe/plugin/CommonsMailer$$anonfun$send$6.class
   846 Fri Oct 24 08:39:04 CEST 2014 com/typesafe/plugin/MockMailer$$anonfun$send$10.class
  5187 Fri Oct 24 08:39:04 CEST 2014 com/typesafe/plugin/MailerBuilder$Attachment.class
  1314 Fri Oct 24 08:39:04 CEST 2014 com/typesafe/plugin/MockMailer$$anonfun$send$14.class
  1514 Fri Oct 24 08:39:04 CEST 2014 com/typesafe/plugin/CommonsMailer$$anonfun$send$7.class
  1269 Fri Oct 24 08:39:04 CEST 2014 com/typesafe/plugin/MailerBuilder$$anon$3.class
  2279 Fri Oct 24 08:39:04 CEST 2014 com/typesafe/plugin/CommonsMailer$$anonfun$send$8$$anonfun$apply$6$$anonfun$apply$7.class
  1025 Fri Oct 24 08:39:04 CEST 2014 com/typesafe/plugin/CommonsMailer$$anon$1$$anonfun$write$1.class
  1136 Fri Oct 24 08:39:04 CEST 2014 com/typesafe/plugin/CommonsMailerPlugin$$anonfun$8.class
  1703 Fri Oct 24 08:39:04 CEST 2014 com/typesafe/plugin/MailerBuilder$$anonfun$e$2.class
 13241 Fri Oct 24 08:39:04 CEST 2014 com/typesafe/plugin/CommonsMailer.class
  1315 Fri Oct 24 08:39:04 CEST 2014 com/typesafe/plugin/MockMailer$$anonfun$send$16.class
  1240 Fri Oct 24 08:39:04 CEST 2014 com/typesafe/plugin/MockMailer$$anonfun$send$16$$anonfun$apply$15.class
  2220 Fri Oct 24 08:39:04 CEST 2014 com/typesafe/plugin/CommonsMailer$$anonfun$send$8$$anonfun$apply$8.class
   922 Fri Oct 24 08:39:04 CEST 2014 com/typesafe/plugin/CommonsMailer$$anonfun$5.class
  1581 Fri Oct 24 08:39:04 CEST 2014 com/typesafe/plugin/CommonsMailer$$anonfun$send$3.class
  1562 Fri Oct 24 08:39:04 CEST 2014 com/typesafe/plugin/CommonsMailer$$anonfun$send$5$$anonfun$apply$4.class
  1136 Fri Oct 24 08:39:04 CEST 2014 com/typesafe/plugin/MailerBuilder$$anonfun$e$3.class
  1248 Fri Oct 24 08:39:04 CEST 2014 com/typesafe/plugin/MockMailer$$anonfun$send$13$$anonfun$apply$12.class
  1246 Fri Oct 24 08:39:04 CEST 2014 com/typesafe/plugin/MockMailer$$anonfun$send$17$$anonfun$apply$16.class
  1563 Fri Oct 24 08:39:04 CEST 2014 com/typesafe/plugin/CommonsMailer$$anonfun$send$6$$anonfun$apply$5.class
  1124 Fri Oct 24 08:39:04 CEST 2014 com/typesafe/plugin/CommonsMailer$$anon$1$$anonfun$write$2.class
  1581 Fri Oct 24 08:39:04 CEST 2014 com/typesafe/plugin/CommonsMailer$$anonfun$send$2.class
  1305 Fri Oct 24 08:39:04 CEST 2014 com/typesafe/plugin/CommonsMailer$$anonfun$send$8$$anonfun$6.class
  9495 Fri Oct 24 08:39:04 CEST 2014 com/typesafe/plugin/MailerBuilder$class.class
  1297 Fri Oct 24 08:39:04 CEST 2014 com/typesafe/plugin/CommonsMailerPlugin$$anonfun$enabled$1.class
  1567 Fri Oct 24 08:39:04 CEST 2014 com/typesafe/plugin/CommonsMailer$$anonfun$send$3$$anonfun$apply$2.class
  1448 Fri Oct 24 08:39:04 CEST 2014 com/typesafe/plugin/MockMailer$$anonfun$send$18$$anonfun$apply$17.class
  1263 Fri Oct 24 08:39:04 CEST 2014 com/typesafe/plugin/MailerBuilder$$anon$2.class
   944 Fri Oct 24 08:39:06 CEST 2014 com/typesafe/plugin/MailerApiJavaInterop.class
  1612 Fri Oct 24 08:39:04 CEST 2014 com/typesafe/plugin/MailerBuilder$$anonfun$e$1.class
 10429 Fri Oct 24 08:39:04 CEST 2014 com/typesafe/plugin/MockMailer$.class
  1317 Fri Oct 24 08:39:04 CEST 2014 com/typesafe/plugin/CommonsMailer$$anon$1.class
  1242 Fri Oct 24 08:39:04 CEST 2014 com/typesafe/plugin/MockMailer$$anonfun$send$12$$anonfun$apply$11.class
  2588 Fri Oct 24 08:39:04 CEST 2014 com/typesafe/plugin/CommonsMailer$$anonfun$send$8.class
  1009 Fri Oct 24 08:39:04 CEST 2014 com/typesafe/plugin/CommonsMailerPlugin$$anonfun$2.class
  1314 Fri Oct 24 08:39:04 CEST 2014 com/typesafe/plugin/MockMailer$$anonfun$send$15.class
  1564 Fri Oct 24 08:39:04 CEST 2014 com/typesafe/plugin/CommonsMailer$$anonfun$send$2$$anonfun$apply$1.class
  1248 Fri Oct 24 08:39:04 CEST 2014 com/typesafe/plugin/MockMailer$$anonfun$send$11$$anonfun$apply$10.class
  1009 Fri Oct 24 08:39:04 CEST 2014 com/typesafe/plugin/CommonsMailerPlugin$$anonfun$4.class
  1562 Fri Oct 24 08:39:04 CEST 2014 com/typesafe/plugin/CommonsMailer$$anonfun$send$4$$anonfun$apply$3.class
  1581 Fri Oct 24 08:39:04 CEST 2014 com/typesafe/plugin/CommonsMailer$$anonfun$send$5.class
   973 Fri Oct 24 08:39:04 CEST 2014 com/typesafe/plugin/CommonsMailerPlugin$$anonfun$mock$1.class
  1092 Fri Oct 24 08:39:04 CEST 2014 com/typesafe/plugin/MockMailer$$anonfun$send$20.class
  1010 Fri Oct 24 08:39:04 CEST 2014 com/typesafe/plugin/CommonsMailerPlugin$$anonfun$1.class
  1238 Fri Oct 24 08:39:04 CEST 2014 com/typesafe/plugin/MockMailer$$anonfun$send$15$$anonfun$apply$14.class

There isn't a package play.api.libs

I found a related problem on [http://stackoverflow.com/questions/27130048/how-to-use-play-plugins-mailer-with-play-2-3-and-scala-2-11]

I don't want to build from sources, so could you please fix and release a correct version?

unresolved dependency: javax.activation#activation;1.1.1

It seems that sbt can't resolve the javax.activation transitive dependency.

Using Play! 2.4.x.

In build.sbt:

libraryDependencies ++= Seq(
    // other things...

    "com.typesafe.play" %% "play-mailer" % "3.0.1"
)

When attempting to compile with sbt there is a dependency resolution error:

[warn]  ::::::::::::::::::::::::::::::::::::::::::::::
[warn]  ::          UNRESOLVED DEPENDENCIES         ::
[warn]  ::::::::::::::::::::::::::::::::::::::::::::::
[warn]  :: javax.activation#activation;1.1.1: configuration not found in javax.activation#activation;1.1.1: 'master(compile)'. Missing configuration: 'compile'. It was required from org.apache.commons#commons-email;1.3.3 compile
[warn]  ::::::::::::::::::::::::::::::::::::::::::::::
[warn]
[warn]  Note: Unresolved dependencies path:
[warn]      javax.activation:activation:1.1.1
[warn]        +- org.apache.commons:commons-email:1.3.3
[warn]        +- com.typesafe.play:play-mailer_2.11:2.4.1 (/Users/pete/projects/issuance/build.sbt#L14-31)
[warn]        +- issuance:issuance_2.11:1.0-SNAPSHOT
...
sbt.ResolveException: unresolved dependency: javax.activation#activation;1.1.1: configuration not found in javax.activation#activation;1.1.1: 'master(compile)'. Missing configuration: 'compile'. It was required from org.apache.commons#commons-email;1.3.3 compile

NoClassDefFoundError org/apache/commons/mail/MultiPartEmail

Hello im working on a play project
and im trying to get this plugin working.

But im getting this error:

Exception in thread "main" java.lang.NoClassDefFoundError: org/apache/commons/mail/MultiPartEmail
    at play.api.libs.mailer.CommonsMailerPlugin.mailerInstance$lzycompute(MailerPlugin.scala:531)

https://gist.github.com/hendrik-weiler/8def78a77f2802a69c18

Ive build the plugin from source and add it to the lib folder.
Im running the dist application using this script:
https://github.com/rpgboss/rpgboss-asset-server/blob/master/run-asset-server.sh

The project im working on:
https://github.com/rpgboss/rpgboss-asset-server

"Could not find a suitable constructor in com.typesafe.plugin.CommonsMailerPlugin" on play-2.4.0-M2

Trying to friend play-2.4 with play-mailer plugin, but:

[error] application - 

! @6keh7m8ll - Internal server error, for (GET) [/] ->

play.api.UnexpectedException: Unexpected exception[ConfigurationException: Guice configuration errors:

1) Could not find a suitable constructor in com.typesafe.plugin.CommonsMailerPlugin. Classes must have either one (and only one) constructor annotated with @Inject or a zero-argument constructor that is not private.
  at com.typesafe.plugin.CommonsMailerPlugin.class(MailerPlugin.scala:490)
  while locating com.typesafe.plugin.CommonsMailerPlugin

1 error]
    at play.core.ReloadableApplication$$anonfun$get$1$$anonfun$apply$1$$anonfun$1.apply(ApplicationProvider.scala:176) ~[play_2.11-2.4.0-M2.jar:2.4.0-M2]
    at play.core.ReloadableApplication$$anonfun$get$1$$anonfun$apply$1$$anonfun$1.apply(ApplicationProvider.scala:130) ~[play_2.11-2.4.0-M2.jar:2.4.0-M2]
    at scala.Option.map(Option.scala:145) ~[scala-library-2.11.4.jar:na]
    at play.core.ReloadableApplication$$anonfun$get$1$$anonfun$apply$1.apply(ApplicationProvider.scala:130) ~[play_2.11-2.4.0-M2.jar:2.4.0-M2]
    at play.core.ReloadableApplication$$anonfun$get$1$$anonfun$apply$1.apply(ApplicationProvider.scala:128) ~[play_2.11-2.4.0-M2.jar:2.4.0-M2]
Caused by: com.google.inject.ConfigurationException: Guice configuration errors:

1) Could not find a suitable constructor in com.typesafe.plugin.CommonsMailerPlugin. Classes must have either one (and only one) constructor annotated with @Inject or a zero-argument constructor that is not private.
  at com.typesafe.plugin.CommonsMailerPlugin.class(MailerPlugin.scala:490)
  while locating com.typesafe.plugin.CommonsMailerPlugin

1 error
    at com.google.inject.internal.InjectorImpl.getProvider(InjectorImpl.java:1004) ~[guice-3.0.jar:na]
    at com.google.inject.internal.InjectorImpl.getProvider(InjectorImpl.java:961) ~[guice-3.0.jar:na]
    at com.google.inject.internal.InjectorImpl.getInstance(InjectorImpl.java:1013) ~[guice-3.0.jar:na]
    at play.api.inject.guice.GuiceInjector.instanceOf(GuiceApplicationLoader.scala:140) ~[play_2.11-2.4.0-M2.jar:2.4.0-M2]
    at play.api.Plugins$$anonfun$loadPlugins$1.apply(Plugins.scala:89) ~[play_2.11-2.4.0-M2.jar:2.4.0-M2]

package play.libs.mailer does not exist

1.- package play.libs.mailer does not exist
2.- package play.libs.mailer.MailerPlugin does not exist

your whole plugin doesn't work :S is there any alternative?

Next release

Hi All,

The "configure" method is a real plus.
Please do you know when the change will be released ?

Regards,

PYC

Testing that an email is sent

Is there a way to test that an email is sent, and check the contents of it? Would be nice to do something like:

"A verification email is sent when the user has registered" in {
  MailPlugin.startCapturing()
  UserModule.registerNewUser(name = "Frodo", email = "[email protected]")
  val emails: List[Email] = MailPlugin.stopCapturingAndCollectResults()

  emails mustEqual List(
    Email(
      subject = "Welcome Frodo",
      recipient = "[email protected]",
      bodyText = "Here is your verifcation link: ______"
    )
  )
}

Or perhaps something more "functional"/safe:

"A verification email is sent when the user has registered" in {
  val emails: List[Email] = MailPlugin.captureMailsSentInBlock {
    UserModule.registerNewUser(name = "Frodo", email = "[email protected]")
  }

  emails mustEqual List(
    Email(
      subject = "Welcome Frodo",
      recipient = "[email protected]",
      bodyText = "Here is your verifcation link: ______"
    )
  )
}

Is it possible to do something like this at all right now? ie. Setting the plugin in testing/capture mode so that we can verify: (1) that en email is sent, (2) verify the contents of it.

Also, mock-mode must be on when running your test suite, right? (play.mailer.mock = yes)

I'm sorry if this is asked before, but I couldn't find anything in the manual or from searching.

Test Play App with smtp.mock=true configuration param raises an error

I hav set in my application configuration the param smpt.mock=true and I get the following error by executing the testcae. What should be wrong?

java.lang.RuntimeException: smtp.host needs to be set in application.conf in order to use this plugin (or set smtp.mock to true)

smtp.mock=true
#smtp.host=smtp.gmail.com
#smtp.port=587
#smtp.ssl=true
#smtp.user="xxx"
#smtp.password=xxx
    @Test
    public void testIndexWithTestServerRunnable() {
        running(testServer(3333), new Runnable() {
            @Override
            public void run() {
                assertThat(
                        WS.url("http://localhost:3333").get().get(5000).getStatus()
                ).isEqualTo(OK);
            }
        });
    }

Release with bugfixes.

Hi. Can you make 2.4.1 or 2.4.1-SNAPSHOT release. I need issues from this commit : 3ae39a8
to be fixed pretty bad.
Thanks

Misleading ReadMe.md

Looks like the Readme.md is misleading. The information doesnot help while testing for Play 2.3.6.

Publish version 5.0.0.M1 version

This version will be compatible with Play! 2.5 and will make it easier to use dynamic configuration with runtime DI: #81

This version must be released from master branch.

Provide convenience method for getting a reference to the mailer API

Previously the play-mailer depended on play plugins util for users to conveniently access it. Let's remove this dependency.

Instead create an object that takes an implicit application to get the mailer in Scala, and a plain old static method in Java.

For Play 2.4, we should switch to using the new modules API and expect people to use DI.

Split the MailerPlugin and the MailerPluginSpec into multiple files

Currently the MailerPlugin and the MailerPluginSpec used a single file for their plugin, however that isn't suitable anymore since the project grown and now contains a lot of classes / lines of code in a single file.

To cleanup this plugin we should split the most classes into a single file / group them when they should stick together.

Move to new configuration structure

We've migrated all of the Play config to provide all defaults in reference.conf, even optional values, these get a default of null, and documenting everything in there. play-mailer should do this too. Additionally, we've namespaced everything in play. I think the mailer should use the namespace of play.mailer.

Whoever implements this, take a look at play.api.PlayConfig, this can be used to "deprecate" the old config, so we can say:

val mailerConfig = PlayConfig(configuration).getDeprecated[PlayConfig]("play.mailer", "smtp")

That way, the user gets a deprecation warning if they have anything configured at smtp.

Support Content-Transfer-Encoding or more MimeHeaders

Hello, currently it would be great if we would have more options in specifing Mime Data.

I think the only way to handle that as good as possible would be a more loose mime field which would just append the necessary Bytes.
Like a List[(String, String)] or something which will be appended without validation

Instantiation of a MailerClient

I would like to instantiate an instance of a MailerClient outside of a Play controller or component (i.e. without dependency injection) for usage in a Util object, like:

object Util {
val mailerClient = xxxxx
def sendMail(email: Email) {
mailer.send(email)
}

Do I have to use native Guice or how does this work?

Thanks,
Peter

MailPlugin not found in 3.0.0-M1

I checked the contribution guidelines, and I still didnt know whether I should post this on the mailing list or here. But the 3.0.0-M1 is broken and not compatible with play2.4, as (I checked in the code) it does not have the MailPlugin object. Are you able to release a M2 as soon as you get the chance?

Play2.4 Field Injection always return null MailerClient

Was following the Java example on home page, use Field injection in Play 2.4. But in debug it seems always have null for MailerClient.

code looks like this:

class EnvelopJob implements Runnable {
        Mail.Envelop envelop;

        @Inject MailerClient mailerClient;

        public EnvelopJob(Mail.Envelop envelop) {
            this.envelop = envelop;
        }

        public void run() {
            Email email = new Email();

            final Configuration root = Configuration.root();
            final String mailFrom = root.getString("mail.from");
            email.setFrom(mailFrom);
            email.setSubject(envelop.subject);
            for (String toEmail : envelop.toEmails) {
                email.addTo(toEmail);
                Logger.debug("Mail.sendMail: Mail will be sent to " + toEmail);
            }

            final String mailSign = root.getString("mail.sign");
            email.setBodyText(envelop.message + "\n\n " + mailSign);
            mailerClient.send(email);
        }
}

Configuration should be changeable in Code

Hello, currently the configuration of the Mailer is only changeable inside the application.conf,
however that is aweful since sometimes you wan't to make it User Configurable.

Having an issue building the master branch (JDK?)

When trying to compile master I get :

sbt.ResolveException: unresolved dependency: org.json4s#json4s-native_2.10;3.2.10: configuration not found in org.json4s#json4s-native_2.10;3.2.10: 'master(compile)'. Missing configuration: 'compile'. It was required from net.databinder.dispatch#dispatch-json4s-native_2.10;0.11.2 compile

The 2.3.x branch builds find. From what I can tell the only diff between the branches that would cause issues with building is the switch to v8 of the JDK. Which is strange since I'm running Java 8:

$ java -version
java version "1.8.0_45"
Java(TM) SE Runtime Environment (build 1.8.0_45-b14)
Java HotSpot(TM) 64-Bit Server VM (build 25.45-b02, mixed mode)
 $ javac -version
javac 1.8.0_45

Any ideas? I'm probably missing something simple!
Thanks

Create a sendAsync method

When I send an email I don't want to "block" my process. I'm using Akka to "schedule" the send:

Akka.system.scheduler.scheduleOnce(1.seconds) {
}

Maybe we can add a sendAsync to the API to do that ? or just an example in the documentation ?
And it might be better to return a Future ?

SMTPConfiguration causing Compilation error

package mail

import javax.inject.Provider

import play.api.libs.SMTPConfiguration
import play.api.{Configuration, Environment}
import play.api.inject.Module

class TestMailerConfigurationProvider extends Provider[SMTPConfiguration] {
    override def get() = new SMTPConfiguration("http://192.168.9.2", 25)
}

class TestMailerConfigurationModule extends Module {
    def bindings(environment: Environment, configuration: Configuration) = Seq(
        bind[SMTPConfiguration].toProvider[TestConfigurationProvider]
    )
}

Hi, I'm pretty new to Scala here so pardon me in advance. Above is my implementation of runtime mailer provider override as seen in the samples of this repo. However, this causes a CompilationError due to [object SMTPConfiguration is not a member of package play.api.libs.mailer]

My current version of mailer included in built.sbt is

"com.typesafe.play" %% "play-mailer" % "3.0.1"
Is this class not included in the package as of that version?

Thank you for your help in advance.

Could we add a .editorconfig?

Currently it's always hard to force a certain style to your editor, for that there is a great plugin called editorconfig. Could I support a PR to support that?

Inject mailerClient in Global.java

In my Global.java I'm trying to schedule a task which has to sent an email every now and then based on some parameters. I can't seem to access mailerClient though, because I always get a NullPointerException. Can someone explain what I'm doing wrong? My code looks roughly like this:

public class Global extends GlobalSettings {
   @Inject MailerClient mailerClient;

   public void onStart(Application app) {
       // lines of code
       Runnable showTime = new Runnable() {
          @Override
          public void run() {
             //lines of code
             mailerClient.send(email);
          }
       }
    }
}

I can't seem to figure out what's going wrong, any help is appreciated.

Adding the user email to the HTML body doing bulk emails

A question: is it possible in a bulk email situation to add the target email to the html?

Google's guidelines suggest that there should be an unsubscribe link which only needs one click for the user to unsubscribe. This means that each email is unique. Currently I add all my recipients to a single message, but I don't see a way of doing this.

I haven't tested the impact of creating 5000+ separate emails, and that might be an option, but I would first like to check if there is a more efficient way.

How is someone that is not (yet) fully Play/Scala/SBT literate supposed to tell what the actual version number is?

I've tried

sbt.ResolveException: unresolved dependency: com.typesafe.play#play-mailer;2.4.0-RC1: not found
sbt.ResolveException: unresolved dependency: com.typesafe.play#play-mailer;2.4.0: not found
sbt.ResolveException: unresolved dependency: com.typesafe.play#play-mailer;2.4.1: not found
sbt.ResolveException: unresolved dependency: com.typesafe.play#play-mailer;2.4.1-SNAPSHOT: not found
sbt.ResolveException: unresolved dependency: com.typesafe.play#play-mailer;3.0.0-M1: not found
sbt.ResolveException: unresolved dependency: com.typesafe.play#play-mailer;{version}: not found 

(just in case this was supposed to be an automatic thingy...)

There must be some "obvious" way to determine exactly what the current version is to the initiated.

Please initiate me :)

I fell in love with Play -- turns out that I'm really starting to hate sbt :(

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.