Module: SmartSMS::Template
- Defined in:
- lib/smart_sms/template.rb
Overview
module that handle Template
Class Method Summary collapse
-
.create(tpl_content = '') ⇒ Object
创建新模板 规则请参见: <www.yunpian.com/api/tpl.html>.
-
.destroy(tpl_id = '') ⇒ Object
删除模板, 需指定id.
-
.find(tpl_id = '') ⇒ Object
取自定义模板 Options:.
-
.find_default(tpl_id = '') ⇒ Object
取默认模板 Options:.
-
.update(tpl_id = '', tpl_content = '') ⇒ Object
更新模板, 需指定id和content.
Class Method Details
.create(tpl_content = '') ⇒ Object
创建新模板规则请参见: <www.yunpian.com/api/tpl.html>
29 30 31 |
# File 'lib/smart_sms/template.rb', line 29 def create(tpl_content = '') Request.post 'tpl/add.json', tpl_content: tpl_content end |
.destroy(tpl_id = '') ⇒ Object
删除模板, 需指定id
40 41 42 |
# File 'lib/smart_sms/template.rb', line 40 def destroy(tpl_id = '') Request.post 'tpl/del.json', tpl_id: tpl_id end |
.find(tpl_id = '') ⇒ Object
取自定义模板Options:
* tpl_id: 指定tpl_id时返回tpl_id对应的自定义模板. 未指定时返回所有自定义模板
22 23 24 |
# File 'lib/smart_sms/template.rb', line 22 def find(tpl_id = '') Request.post 'tpl/get.json', tpl_id: tpl_id end |