Email is now functional
This commit is contained in:
parent
507cf9edd1
commit
2e63653e78
@ -32,6 +32,7 @@ class Email {
|
|||||||
logger.debug("Constructing email")
|
logger.debug("Constructing email")
|
||||||
val email = EmailBuilder.startingBlank()
|
val email = EmailBuilder.startingBlank()
|
||||||
.to("Simulator Team", environment.getProperty("smtp.toaddress"))
|
.to("Simulator Team", environment.getProperty("smtp.toaddress"))
|
||||||
|
.from("noreply@obsdb")
|
||||||
.withSubject("Observation Session Data")
|
.withSubject("Observation Session Data")
|
||||||
.withPlainText("Attached observation data was generated: ${DateTime.now()}.")
|
.withPlainText("Attached observation data was generated: ${DateTime.now()}.")
|
||||||
.withAttachment("observations.csv", observationsToCSV(observations).toByteArray(), "text/csv")
|
.withAttachment("observations.csv", observationsToCSV(observations).toByteArray(), "text/csv")
|
||||||
|
@ -9,7 +9,7 @@
|
|||||||
"type": "java.lang.Boolean"
|
"type": "java.lang.Boolean"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"name": "smtp.server",
|
"name": "smtp.host",
|
||||||
"type": "java.lang.String"
|
"type": "java.lang.String"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
|
@ -7,7 +7,7 @@ spring.cache.cache-names=observations,charts
|
|||||||
spring.cache.caffeine.spec=maximumSize=500,expireAfterAccess=600s
|
spring.cache.caffeine.spec=maximumSize=500,expireAfterAccess=600s
|
||||||
management.endpoints.web.exposure.include=health,info,metrics
|
management.endpoints.web.exposure.include=health,info,metrics
|
||||||
smtp.enabled=false
|
smtp.enabled=false
|
||||||
smtp.server=x
|
smtp.host=x
|
||||||
smtp.port=587
|
smtp.port=587
|
||||||
smtp.username=none
|
smtp.username=none
|
||||||
smtp.password=none
|
smtp.password=none
|
||||||
|
@ -372,7 +372,16 @@ export default {
|
|||||||
this.startDate = moment().subtract(amount, timeType);
|
this.startDate = moment().subtract(amount, timeType);
|
||||||
},
|
},
|
||||||
sendEmail: function() {
|
sendEmail: function() {
|
||||||
Vue.axios.post("/observations/email").catch(error => {
|
Vue.axios
|
||||||
|
.post("/observations/email", {
|
||||||
|
site: this.$store.state.search.site,
|
||||||
|
tutor: this.$store.state.search.tutor,
|
||||||
|
startDate: moment(this.startDate).format("YYYY-MM-DD"),
|
||||||
|
endDate: moment(this.endDate).format("YYYY-MM-DD"),
|
||||||
|
whom: this.$store.state.search.whom,
|
||||||
|
person: this.$store.state.search.person
|
||||||
|
})
|
||||||
|
.catch(error => {
|
||||||
this.errorStatus = error.response.status;
|
this.errorStatus = error.response.status;
|
||||||
this.errorMessage = error.response.data;
|
this.errorMessage = error.response.data;
|
||||||
this.$refs.errorModal.show();
|
this.$refs.errorModal.show();
|
||||||
|
Loading…
Reference in New Issue
Block a user