37 lines
1.3 KiB
HTML
37 lines
1.3 KiB
HTML
{% if not hide_footer_signup %}
|
|
|
|
<input class="form-control" type="text" id="footer-subscribe-email"
|
|
style="display: inline-block; max-width: 50%;margin-right:15px;"
|
|
placeholder="{{ _('Your email address') }}...">
|
|
<button class="btn btn-default btn-sm btn-subscribe" type="button"
|
|
id="footer-subscribe-button" style="float:right; border-radius:8px; border:1px solid #7575ff; color:#7575ff; background-color:white;">{{ _("Get Updates") }}</button>
|
|
|
|
<script>
|
|
frappe.ready(function() {
|
|
$("#footer-subscribe-button").click(function() {
|
|
|
|
if($("#footer-subscribe-email").val()) {
|
|
$("#footer-subscribe-email").attr('disabled', true);
|
|
$("#footer-subscribe-button").html("Sending...")
|
|
.attr("disabled", true);
|
|
erpnext.subscribe_to_newsletter({
|
|
email: $("#footer-subscribe-email").val(),
|
|
callback: function(r) {
|
|
if(!r.exc) {
|
|
$("#footer-subscribe-button").html(__("Added"))
|
|
.attr("disabled", true);
|
|
} else {
|
|
$("#footer-subscribe-button").html(__("Error: Not a valid id?"))
|
|
.addClass("btn-danger").attr("disabled", false);
|
|
$("#footer-subscribe-email").val("").attr('disabled', false);
|
|
}
|
|
}
|
|
});
|
|
}
|
|
else
|
|
frappe.msgprint(frappe._("Please enter email address"))
|
|
});
|
|
});
|
|
</script>
|
|
{% endif %}
|