Back to Postgresml

Template

pgml-dashboard/src/components/cards/newsletter_subscribe/template.html

2.10.01.1 KB
Original Source

% use crate::components::cards::Psychedelic; let success_class = match success { Some(true) => "success", Some(false) => "error", None => "" }; let message = match success { Some(true) => "Success".to_string(), Some(false) => error_message.unwrap_or("Something went wrong".to_string()), None => String::new() }; let error_icon = match success { Some(false) => r#"warning"#, _ => "" }; let email_placeholder = match &email { Some(email) => email.clone().to_string(), None => { let message = match success { Some(true) => "Add Another Email".to_string(), _ => "[email protected]".to_string() }; message } }; let email_val = match email { Some(ref email) => "value="".to_string() + &email + """, None => String::new() }; %> <%+ Psychedelic::new() .set_content(format!(r#"

Subscribe to our newsletter. (It's better than you think)

No spam. No sales pitches. Just product updates. Keep up with all our articles and news. Join our newsletter and stay up to date!

{error_icon} Subscribe Subscribe

{message}

"#).into()) .set_color_pink() %>