1 use smbcloud_network::environment::Environment;
2
3 /// API credential for the smbCloud transactional email API.
4 ///
5 /// `api_key` is a `smb_mail_…` key minted for a Mail app in the smbCloud
6 /// console. It is sent as `Authorization: Bearer <api_key>` and scopes sending
7 /// to that app's verified domain.
8 #[derive(Clone, Copy)]
9 pub struct EmailCredentials<'a> {
10 pub api_key: &'a str,
11 }
12
13 /// Resolve the email API base URL for the given environment.
14 ///
15 /// - **Dev** → `http://localhost:8088`
16 /// - **Production** → `https://api.smbcloud.xyz`
17 pub fn base_url(environment: &Environment) -> String {
18 format!(
19 "{}://{}",
20 environment.api_protocol(),
21 environment.api_host()
22 )
23 }