Skip to content

Commit

Permalink
fix: minor fix
Browse files Browse the repository at this point in the history
  • Loading branch information
Bisht13 committed May 24, 2024
1 parent b744b2e commit 0e1ca12
Showing 1 changed file with 8 additions and 3 deletions.
11 changes: 8 additions & 3 deletions packages/relayer/src/modules/email_client/mail.rs
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,10 @@ use crate::{
ONBOARDING_REPLY_MSG, ONBOARDING_TOKEN_DISTRIBUTION_LIMIT, RELAYER_EMAIL_ADDRESS,
};
use anyhow::anyhow;
use email_wallet_utils::cryptos::{PaddedEmailAddr, WalletSalt};
use email_wallet_utils::{
converters::field2hex,
cryptos::{PaddedEmailAddr, WalletSalt},
};
use std::{pin::Pin, sync::atomic::Ordering};

pub fn event_consumer(
Expand Down Expand Up @@ -62,7 +65,8 @@ async fn event_consumer_fn(event: EmailWalletEvent, sender: EmailForwardSender)
email address replaced respectively in the subject line.\n{}\nYour wallet address: {}/address/{}.\nCheck the transaction on etherscan: {}/tx/{}",
email_addr, RELAYER_EMAIL_ADDRESS.get().unwrap(), ONBOARDING_REPLY_MSG.get().clone().unwrap_or(&String::new()), CHAIN_RPC_EXPLORER.get().unwrap(), wallet_addr, CHAIN_RPC_EXPLORER.get().unwrap(), tx_hash
);
let render_data = serde_json::json!({"userEmailAddr": email_addr, "relayerEmailAddr": RELAYER_EMAIL_ADDRESS.get().unwrap(), "faucetMessage": ONBOARDING_REPLY_MSG.get().clone().unwrap_or(&String::new()), "walletAddr":wallet_addr, "transactionHash": tx_hash, "chainRPCExplorer": CHAIN_RPC_EXPLORER.get().unwrap()});
let account_key_str = field2hex(&account_key.0);
let render_data = serde_json::json!({"userEmailAddr": email_addr, "relayerEmailAddr": RELAYER_EMAIL_ADDRESS.get().unwrap(), "faucetMessage": ONBOARDING_REPLY_MSG.get().clone().unwrap_or(&String::new()), "walletAddr":wallet_addr, "transactionHash": tx_hash, "chainRPCExplorer": CHAIN_RPC_EXPLORER.get().unwrap(), "accountKey": account_key_str});
let body_html = render_html("account_created.html", render_data).await?;
let email = EmailMessage {
to: email_addr,
Expand Down Expand Up @@ -162,7 +166,8 @@ async fn event_consumer_fn(event: EmailWalletEvent, sender: EmailForwardSender)
"Hi {}!\nCheck the transaction for you on etherscan: {}/tx/{}.\nNote that your wallet address is {}\n",
email_addr, CHAIN_RPC_EXPLORER.get().unwrap(), &tx_hash, wallet_addr
);
let render_data = serde_json::json!({"userEmailAddr": email_addr, "walletAddr":wallet_addr, "transactionHash": tx_hash, "chainRPCExplorer": CHAIN_RPC_EXPLORER.get().unwrap()});
let account_key_str = field2hex(&recipient_account_key.0);
let render_data = serde_json::json!({"userEmailAddr": email_addr, "walletAddr":wallet_addr, "transactionHash": tx_hash, "chainRPCExplorer": CHAIN_RPC_EXPLORER.get().unwrap(), "accountKey": account_key_str});
let body_html = render_html("claimed.html", render_data).await?;
let email = EmailMessage {
to: email_addr,
Expand Down

0 comments on commit 0e1ca12

Please sign in to comment.