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