pub struct TemplateMessage {
pub touser: String,
pub template_id: String,
pub url: Option<String>,
pub miniprogram: Option<TemplateMiniProgram>,
pub data: HashMap<String, TemplateDataItem>,
pub client_msg_id: Option<String>,
}Expand description
Template message request.
Fields§
§touser: StringReceiver’s OpenID
template_id: StringTemplate ID
url: Option<String>Click URL (optional)
miniprogram: Option<TemplateMiniProgram>Mini program link (optional, takes priority over url)
data: HashMap<String, TemplateDataItem>Template data
client_msg_id: Option<String>Client message ID (for deduplication)
Implementations§
Source§impl TemplateMessage
impl TemplateMessage
pub fn new( to_user: impl Into<String>, template_id: impl Into<String>, data: HashMap<String, TemplateDataItem>, ) -> Self
pub fn with_url(self, url: impl Into<String>) -> Self
pub fn with_miniprogram( self, appid: impl Into<String>, pagepath: Option<String>, ) -> Self
pub fn with_client_msg_id(self, id: impl Into<String>) -> Self
Trait Implementations§
Source§impl Clone for TemplateMessage
impl Clone for TemplateMessage
Source§fn clone(&self) -> TemplateMessage
fn clone(&self) -> TemplateMessage
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for TemplateMessage
impl Debug for TemplateMessage
Auto Trait Implementations§
impl Freeze for TemplateMessage
impl RefUnwindSafe for TemplateMessage
impl Send for TemplateMessage
impl Sync for TemplateMessage
impl Unpin for TemplateMessage
impl UnwindSafe for TemplateMessage
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more