/notifications-email

Email Notification Microservice

Primary LanguageJava

Take-home Microservices Challenge

This is how we faced the challenge of creating a notification email services

Table of contents

Overview

The design is structured as shown:

  • src|
    • main
    • java|
      • com/xxx/challenge/notificationEmailService|
        • config
        • dto
        • consumer
        • service
      • test

Screenshot

Links

  • Service Socket: [AMQChannel(amqp://guest@127.0.0.1:5672/,1),]

Built with

My Skills

How I did it

package com.xxxx.challenge.notificationEmailService.service;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.mail.SimpleMailMessage;
import org.springframework.mail.javamail.JavaMailSender;
import org.springframework.stereotype.Service;

@Service
public class MessageNotificationEmailService {


  @Autowired
  private JavaMailSender mailSender;
  
  public void sendNewMail(String to, String subject, String body) {

    SimpleMailMessage message = new SimpleMailMessage();
    message.setTo(to);
    message.setSubject(subject);
    message.setText(body);

    mailSender.send(message);
  }
}

Continued development

  • maybe

Useful resources

Author

Acknowledgments