Skip to content
This repository has been archived by the owner on Aug 2, 2024. It is now read-only.

Commit

Permalink
Remove old email service (spark post email via SMTP server on GCP not…
Browse files Browse the repository at this point in the history
… supported anymore) (#51)
  • Loading branch information
conorheffron authored Jul 22, 2024
1 parent 5278719 commit 7a8ca62
Show file tree
Hide file tree
Showing 9 changed files with 10 additions and 68 deletions.
8 changes: 4 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -29,21 +29,21 @@ docker compose up -d
http://localhost:8080/
```

![SPA-home](./spa-home.png)
![SPA-home](images/spa-home.png)


## View contact requests in embedded DB
```
http://localhost:8080/contact
```
![contact-form](./contact-form.png)
![contact-form](images/contact-form.png)

```
http://localhost:8080/h2-console
```

![h2-console](./h2-console.png)
![h2-console](images/h2-console.png)

![db-query-contacts](db-query-contacts.png)
![db-query-contacts](images/db-query-contacts.png)


File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
2 changes: 1 addition & 1 deletion pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@

<groupId>com.marjade.roniet</groupId>
<artifactId>marjaderoniet</artifactId>
<version>4.1.0</version>
<version>4.1.1</version>
<name>FashionApp</name>
<description>Fashion portfolio</description>

Expand Down
17 changes: 3 additions & 14 deletions src/main/java/com/marjade/roniet/controller/ContactController.java
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@
import com.marjade.roniet.domain.ContactResponse;
import com.marjade.roniet.domain.RequestStatus;
import com.marjade.roniet.model.Contact;
import com.marjade.roniet.service.EmailService;
import org.apache.commons.lang3.StringUtils;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
Expand All @@ -25,9 +24,6 @@ public class ContactController {
@Autowired
private ContactDao contactDao;

@Autowired
private EmailService emailService;

@Autowired
private Environment environment;

Expand All @@ -52,7 +48,7 @@ public class ContactController {

String recipient = environment.getProperty("com.marjade.roniet.email.recipient");
Contact contact = new Contact(email, firstName, lastName, message, recipient);

// send to message queue
contactRequest.setRecipient(recipient);

Expand All @@ -69,15 +65,8 @@ public class ContactController {
return new ContactResponse(false, RequestStatus.SAVE_FAIL);
}

// send email
boolean response = emailService.sendEmail(savedContact);
if (response) {
// success
return new ContactResponse(true, RequestStatus.OK);
}

// else fail
return new ContactResponse(false, RequestStatus.EMAIL_FAILED);
// success
return new ContactResponse(true, RequestStatus.OK);
}

}
49 changes: 0 additions & 49 deletions src/main/java/com/marjade/roniet/service/EmailService.java

This file was deleted.

2 changes: 2 additions & 0 deletions src/main/resources/application.properties
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,8 @@ spring.cloud.gcp.sql.database-name=marjaderoniet-db

# Data Source
spring.h2.console.enabled=true
spring.h2.console.path=/h2-console
spring.h2.console.settings.web-allow-others=true
spring.datasource.url=jdbc:h2:mem:marjaderoniet;DB_CLOSE_DELAY=-1;DB_CLOSE_ON_EXIT=FALSE;AUTO_RECONNECT=TRUE;
spring.datasource.username=sa
spring.datasource.password=password
Expand Down

0 comments on commit 7a8ca62

Please sign in to comment.