module SmartSMS::Template

module that handle `Template`

Public Instance Methods

create(tpl_content = '') click to toggle source

创建新模板 规则请参见: <www.yunpian.com/api/tpl.html>

# 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 = '') click to toggle source

删除模板, 需指定id

# 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 = '') click to toggle source

取自定义模板 Options:

* tpl_id: 指定tpl_id时返回tpl_id对应的自定义模板. 未指定时返回所有自定义模板
# File lib/smart_sms/template.rb, line 22
def find(tpl_id = '')
  Request.post 'tpl/get.json', tpl_id: tpl_id
end
find_default(tpl_id = '') click to toggle source

取默认模板 Options:

* tpl_id: 指定tpl_id时返回tpl_id对应的默认模板. 未指定时返回所有默认模板
# File lib/smart_sms/template.rb, line 13
def find_default(tpl_id = '')
  Request.post 'tpl/get_default.json', tpl_id: tpl_id
end
update(tpl_id = '', tpl_content = '') click to toggle source

更新模板, 需指定id和content

# File lib/smart_sms/template.rb, line 35
def update(tpl_id = '', tpl_content = '')
  Request.post 'tpl/update.json', tpl_id: tpl_id, tpl_content: tpl_content
end