-
Notifications
You must be signed in to change notification settings - Fork 434
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
(BIDS-2496) move support emails to config (#2575)
- Loading branch information
1 parent
f0a817e
commit 2a5ba87
Showing
7 changed files
with
14 additions
and
94 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -39,13 +39,15 @@ func AdvertiseWithUs(w http.ResponseWriter, r *http.Request) { | |
func AdvertiseWithUsPost(w http.ResponseWriter, r *http.Request) { | ||
err := r.ParseForm() | ||
if err != nil { | ||
utils.LogError(err, "error parsing form", 0) | ||
utils.LogError(err, "error parsing ad request form", 0, map[string]interface{}{ | ||
"route": r.URL.String(), | ||
}) | ||
utils.SetFlash(w, r, "ad_flash", "Error: invalid form submitted") | ||
http.Redirect(w, r, "/advertisewithus", http.StatusSeeOther) | ||
return | ||
} | ||
|
||
if err := utils.HandleRecaptcha(w, r, "/pricing"); err != nil { | ||
if err := utils.HandleRecaptcha(w, r, "/advertisewithus"); err != nil { | ||
return | ||
} | ||
|
||
|
@@ -66,7 +68,7 @@ func AdvertiseWithUsPost(w http.ResponseWriter, r *http.Request) { | |
// escape html | ||
msg = template.HTMLEscapeString(msg) | ||
|
||
err = mail.SendTextMail("[email protected]", "New ad inquiry", msg, []types.EmailAttachment{}) | ||
err = mail.SendTextMail(utils.Config.Frontend.Mail.Contact.InquiryEmail, "New ad inquiry", msg, []types.EmailAttachment{}) | ||
if err != nil { | ||
logger.Errorf("error sending ad form: %v", err) | ||
utils.SetFlash(w, r, "ad_flash", "Error: unable to submit ad request") | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,12 +1,9 @@ | ||
package handlers | ||
|
||
import ( | ||
"eth2-exporter/mail" | ||
"eth2-exporter/templates" | ||
"eth2-exporter/types" | ||
"eth2-exporter/utils" | ||
"fmt" | ||
"html/template" | ||
"net/http" | ||
) | ||
|
||
|
@@ -33,44 +30,3 @@ func MobilePage(w http.ResponseWriter, r *http.Request) { | |
return // an error has occurred and was processed | ||
} | ||
} | ||
|
||
func MobilePagePost(w http.ResponseWriter, r *http.Request) { | ||
err := r.ParseForm() | ||
if err != nil { | ||
utils.LogError(err, "error parsing form", 0) | ||
utils.SetFlash(w, r, "ad_flash", "Error: invalid form submitted") | ||
http.Redirect(w, r, "/mobile", http.StatusSeeOther) | ||
return | ||
} | ||
|
||
if err := utils.HandleRecaptcha(w, r, "/pricing"); err != nil { | ||
return | ||
} | ||
|
||
name := r.FormValue("name") | ||
email := r.FormValue("email") | ||
url := r.FormValue("url") | ||
company := r.FormValue("company") | ||
text := r.FormValue("text") | ||
|
||
msg := fmt.Sprintf(`New app pool support inquiry: | ||
Name: %s | ||
Email: %s | ||
Url: %s | ||
Company: %s | ||
Message: %s`, | ||
name, email, url, company, text) | ||
// escape html | ||
msg = template.HTMLEscapeString(msg) | ||
|
||
err = mail.SendTextMail("[email protected]", "New app pool support inquiry", msg, []types.EmailAttachment{}) | ||
if err != nil { | ||
logger.Errorf("error sending app pool form: %v", err) | ||
utils.SetFlash(w, r, "ad_flash", "Error: unable to submit app pool request") | ||
http.Redirect(w, r, "/mobile", http.StatusSeeOther) | ||
return | ||
} | ||
|
||
utils.SetFlash(w, r, "ad_flash", "Thank you for your inquiry, we will get back to you as soon as possible.") | ||
http.Redirect(w, r, "/mobile", http.StatusSeeOther) | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -113,9 +113,10 @@ func MobilePricing(w http.ResponseWriter, r *http.Request) { | |
func PricingPost(w http.ResponseWriter, r *http.Request) { | ||
err := r.ParseForm() | ||
if err != nil { | ||
utils.LogError(err, "error parsing form", 0) | ||
utils.LogError(err, "error parsing form for pricing request", 0, map[string]interface{}{ | ||
"route": r.URL.String(), | ||
}) | ||
utils.SetFlash(w, r, "pricing_flash", "Error: invalid form submitted") | ||
logger.Errorf("error parsing pricing request form for %v route: %v", r.URL.String(), err) | ||
http.Redirect(w, r, "/pricing", http.StatusSeeOther) | ||
return | ||
} | ||
|
@@ -141,7 +142,7 @@ func PricingPost(w http.ResponseWriter, r *http.Request) { | |
// escape html | ||
msg = template.HTMLEscapeString(msg) | ||
|
||
err = mail.SendTextMail("[email protected]", "New API usage inquiry", msg, []types.EmailAttachment{}) | ||
err = mail.SendTextMail(utils.Config.Frontend.Mail.Contact.InquiryEmail, "New API usage inquiry", msg, []types.EmailAttachment{}) | ||
if err != nil { | ||
logger.Errorf("error sending ad form: %v", err) | ||
utils.SetFlash(w, r, "pricing_flash", "Error: unable to submit api request") | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -536,7 +536,7 @@ func createNewStripeSubscription(subscription stripe.Subscription, event stripe. | |
} | ||
|
||
func emailCustomerAboutFailedPayment(email string) { | ||
msg := fmt.Sprintf("Payment processing failed. Could not activate your subscription. Please contact support at [email protected]. Manage Subscription: https://" + utils.Config.Frontend.SiteDomain + "/user/settings") | ||
msg := fmt.Sprintf("Payment processing failed. Could not activate your subscription. Please contact support at " + utils.Config.Frontend.Mail.Contact.SupportEmail + ". Manage Subscription: https://" + utils.Config.Frontend.SiteDomain + "/user/settings") | ||
// escape html | ||
msg = template.HTMLEscapeString(msg) | ||
err := mail.SendTextMail(email, "Failed Payment", msg, []types.EmailAttachment{}) | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -251,48 +251,6 @@ <h2 class="mb-4">Keeping the network secure is hard enough.<br />Let us help you | |
</div> | ||
</div> | ||
</section> | ||
<br /> | ||
<hr /> | ||
<br /> | ||
<section class="my-5"> | ||
<div class="row"> | ||
<div class="col-md-12"> | ||
<div class="row justify-content-center"> | ||
<div class="col-md-12 col-lg-8 text-center"> | ||
<h1 class="h4">You want your pool supported by the app?</h1> | ||
<p class="text-muted col-md-8 px-0 mx-auto">Reach out to us if you are interested in a partnership.</p> | ||
<form id="contact" action="/mobile" method="post"> | ||
<div class="text-left"> | ||
<div class="form-row"> | ||
<div class="form-group col-md-6"> | ||
<label for="inputName">Contact name (required)</label> | ||
<input type="text" class="form-control" id="inputName" placeholder="Ex.: Vitalik Buterin" required name="name" /> | ||
</div> | ||
<div class="form-group col-md-6"> | ||
<label for="inputEmail">Email (required)</label> | ||
<input type="email" class="form-control" id="inputEmail" placeholder="Ex.: [email protected]" required name="email" /> | ||
</div> | ||
</div> | ||
<div class="form-group"> | ||
<label for="inputUrl">Official Website URL (required)</label> | ||
<input type="text" class="form-control" id="inputUrl" placeholder="Ex.: https://example.com/" required name="url" /> | ||
</div> | ||
<div class="form-group"> | ||
<label for="inputCompanyName">Company / Project name (required)</label> | ||
<input type="text" class="form-control" id="inputCompanyName" placeholder="Ex.: Chainlab" required name="company" /> | ||
</div> | ||
<div class="form-group"> | ||
<label for="inputAddress2">What can we do for you? (required)</label> | ||
<textarea type="text" class="form-control" id="inputAdText" required name="text"></textarea> | ||
</div> | ||
</div> | ||
<button data-sitekey="{{ .RecaptchaKey }}" data-callback="onSubmit" data-action="submit" type="submit" class="g-recaptcha btn btn-primary text-center text-white">Send Message</button> | ||
</form> | ||
</div> | ||
</div> | ||
</div> | ||
</div> | ||
</section> | ||
</div> | ||
{{ end }} | ||
{{ end }} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters