As far I remember, the value injection occurs after the constructor call.
Try to change your constructor to this:
public Email(@Value("${TO_EMAIL}") String toEmail) {
this.toEmail = toEmail;
}
As far I remember, the value injection occurs after the constructor call.
Try to change your constructor to this:
public Email(@Value("${TO_EMAIL}") String toEmail) {
this.toEmail = toEmail;
}