Skip to content

Commit

Permalink
chore: created structs and enum
Browse files Browse the repository at this point in the history
  • Loading branch information
vrn21 committed Aug 9, 2024
1 parent 73b312f commit 3e40934
Show file tree
Hide file tree
Showing 2 changed files with 72 additions and 6 deletions.
74 changes: 68 additions & 6 deletions src/utils/mail_content.rs
Original file line number Diff line number Diff line change
@@ -1,8 +1,71 @@
pub enum Team {
Tech,
Marketing,
Events,
Design,
Content,
}

pub struct Receiver {
name: String,
mailid: String,
team: Team,
whatsapplink: String,
}
impl std::fmt::Display for Team {
fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
let team_name = match self {
Team::Tech => "Tech",
Team::Marketing => "Marketing",
Team::Events => "Events",
Team::Design => "Design",
Team::Content => "Content",
};
write!(f, "{}", team_name)
}
}

impl Receiver {
pub fn new(mailid: String, team: Team, name: String) -> Self {
let whatsapplink = match team {
Team::Tech => {
//paste whtsapp link here without semicolon eg:
//"https://www.api.whatsapp.com/9497807759"
}
Team::Marketing => {
todo!()
//"https://www.api.whatsapp.com/9497807759"
}
Team::Events => {
todo!()
//"https://www.api.whatsapp.com/9497807759"
}
Team::Design => {
todo!()
//"https://www.api.whatsapp.com/9497807759"
}
Team::Content => {
todo!()
//"https://www.api.whatsapp.com/9497807759"
}
_ => {
//"link to not found"
}
};
Receiver {
name,
mailid,
team,
whatsapplink: whatsapplink.to_string(),
}
}
}

pub fn subject() -> String {
"Sending email with Rust".to_string()
}

pub fn mail_content() -> String {
pub fn mail_content(receiver: Receiver) -> String {
r#"<body>
<div style="font-family: Arial, Helvetica, sans-serif; padding: 10px; background-color: #002147; display: flex; align-items: center; justify-content: center; min-height: 100vh;">
<div style="max-width: 600px; margin: 0 auto; padding: 20px; background-color: #ffffff; border-radius: 10px; line-height: 1.6; border: 1px solid #c7c3c3;">
Expand All @@ -13,12 +76,12 @@ pub fn mail_content() -> String {
<div style="text-align: center; margin-top: 20px;">
<h3>You've been selected to join the team</h3>
</div>
<p>Dear _,</p>
<p><strong>Congratulations!</strong> We are delighted to inform you that you have been selected to join the <strong>Events team</strong> of FOSS MEC 2024! Your passion and skills have truly impressed us, and we are excited to have you on board.</p>
<p>Dear {receiver.name},</p>
<p><strong>Congratulations!</strong> We are delighted to inform you that you have been selected to join the <strong>{receiver.team} team</strong> of FOSS MEC 2024! Your passion and skills have truly impressed us, and we are excited to have you on board.</p>
<p>We look forward to working together to conduct various events and build a vibrant community of open source enthusiasts.</p>
<p>Please join the WhatsApp group to stay informed about our upcoming meetings and discussions. We'll be sharing important updates and details there!</p>
<div style="text-align: left; margin: 20px 0;">
<a href="https://www.example.com/join-group" style="text-decoration: none;">
<a href="{receiver.whatsapplink}" style="text-decoration: none;">
<button style="background-color: #F5A212; border: none; color: white; padding: 13px 15px; text-align: center; font-size: 0.8em; cursor: pointer; border-radius: 6px;">
<strong>Join the group</strong>
</button>
Expand All @@ -35,6 +98,5 @@ pub fn mail_content() -> String {
</div>
</div>
</body>
"#
.to_string()
"#.to_string()
}
4 changes: 4 additions & 0 deletions src/utils/recepients.rs
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
pub fn mail_list() -> String {
"[email protected]".to_string()
}

pub fn mail_list_vec() -> Vec<String> {
vec![]
}

0 comments on commit 3e40934

Please sign in to comment.