Skip to content

Commit

Permalink
Add Grails mail 4.0.0 plugin support. Move AsynchronousMailService.gr…
Browse files Browse the repository at this point in the history
…oovy to src folder to save it from SendMail trait enrich.
  • Loading branch information
vsachinv committed Nov 29, 2024
1 parent becdd80 commit 80830e0
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 1 deletion.
6 changes: 6 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,12 @@ Installation

To install just add the plugin to the plugins block of `build.gradle`:

For Grails 6.x.x
```groovy
implementation "io.github.gpc:asynchronous-mail:4.0.0-SNAPSHOT"
```


For Grails 5.x.x
```groovy
implementation "io.github.gpc:asynchronous-mail:3.1.2"
Expand Down
2 changes: 1 addition & 1 deletion build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ dependencies {
implementation 'org.grails.plugins:hibernate5'
implementation 'org.hibernate:hibernate-core:5.6.15.Final'
implementation 'org.grails.plugins:gsp'
implementation 'org.grails.plugins:mail:3.0.0'
implementation 'org.grails.plugins:mail:4.0.0'
// This is needed for the quartz-plugin on grails >= 4.0.x, https://github.com/grails-plugins/grails-quartz/issues/107#issuecomment-575951471
implementation('org.quartz-scheduler:quartz:2.3.2') { exclude group: 'slf4j-api', module: 'c3p0' }
implementation 'org.grails.plugins:quartz:2.0.13'
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,13 +13,15 @@ import org.quartz.TriggerKey
class AsynchronousMailGrailsPlugin extends Plugin {

def grailsVersion = "6.0.0 > *"
def dependsOn = [mail: "* > 4.0.0"]
def loadAfter = ['mail', 'quartz', 'hibernate', 'hibernate3', 'hibernate4', 'hibernate5', 'mongodb']

@Override
Closure doWithSpring() {
{ ->
//noinspection GrUnresolvedAccess
asynchronousMailMessageBuilderFactory(AsynchronousMailMessageBuilderFactory) { it.autowire = true }
asynchronousMailService(AsynchronousMailService) { it.autowire = true }
//noinspection GrUnresolvedAccess
springConfig.addAlias 'asyncMailService', 'asynchronousMailService'
}
Expand Down

0 comments on commit 80830e0

Please sign in to comment.