| 1 | package fr.sii.ogham.spring.v1.email; | |
| 2 | ||
| 3 | import org.springframework.boot.autoconfigure.sendgrid.SendGridProperties; | |
| 4 | ||
| 5 | import com.sendgrid.SendGrid; | |
| 6 | ||
| 7 | import fr.sii.ogham.core.builder.MessagingBuilder; | |
| 8 | import fr.sii.ogham.email.sendgrid.builder.AbstractSendGridBuilder; | |
| 9 | import fr.sii.ogham.email.sendgrid.v2.builder.sendgrid.SendGridV2Builder; | |
| 10 | import fr.sii.ogham.email.sendgrid.v2.sender.impl.sendgrid.client.DelegateSendGridClient; | |
| 11 | import fr.sii.ogham.spring.email.AbstractSpringSendGridConfigurer; | |
| 12 | import fr.sii.ogham.spring.email.OghamSendGridProperties; | |
| 13 | ||
| 14 | public class SpringSendGridV2Configurer extends AbstractSpringSendGridConfigurer { | |
| 15 | ||
| 16 | public SpringSendGridV2Configurer(OghamSendGridProperties properties, SendGridProperties springProperties, SendGrid sendGrid) { | |
| 17 | super(properties, springProperties, sendGrid); | |
| 18 | } | |
| 19 | ||
| 20 | @Override | |
| 21 | protected Class<? extends AbstractSendGridBuilder<?, ?>> getSendGridBuilderClass() { | |
| 22 |
1
1. getSendGridBuilderClass : replaced return value with null for fr/sii/ogham/spring/v1/email/SpringSendGridV2Configurer::getSendGridBuilderClass → KILLED |
return SendGridV2Builder.class; |
| 23 | } | |
| 24 | ||
| 25 | @Override | |
| 26 | protected void useSpringSendGridClient(MessagingBuilder builder) { | |
| 27 | // @formatter:off | |
| 28 | builder.email() | |
| 29 | .sender(SendGridV2Builder.class) | |
| 30 | .client(new DelegateSendGridClient(sendGrid)); | |
| 31 | // @formatter:on | |
| 32 | } | |
| 33 | ||
| 34 | @Override | |
| 35 | protected void useOghamSendGridClientWithSpringProperties(MessagingBuilder builder) { | |
| 36 |
1
1. useOghamSendGridClientWithSpringProperties : removed call to fr/sii/ogham/spring/email/AbstractSpringSendGridConfigurer::useOghamSendGridClientWithSpringProperties → KILLED |
super.useOghamSendGridClientWithSpringProperties(builder); |
| 37 | // @formatter:off | |
| 38 | builder.email() | |
| 39 | .sender(SendGridV2Builder.class) | |
| 40 | .username(springProperties.getUsername()) | |
| 41 | .password(springProperties.getPassword()); | |
| 42 | // @formatter:on | |
| 43 | } | |
| 44 | } | |
Mutations | ||
| 22 |
1.1 |
|
| 36 |
1.1 |