Sha256: 8fd5859145ba2a3a042facf1a49b761a2991ee488cf19656ee61dacb26260b74
Contents?: true
Size: 1.71 KB
Versions: 17
Compression:
Stored size: 1.71 KB
Contents
module Klaviyo module Templates # https://www.klaviyo.com/docs/api/email-templates # module ApiOperations def all(client:) Klaviyo::Resource.build_collection( client.conn.get('/api/v1/email-templates', api_key: client.api_key ).body ) end def create(client:, name:, html:) client.conn.post( '/api/v1/email-templates', api_key: client.api_key, name: name, html: html ) end def update(client:, id:, name:, html:) client.conn.put( "/api/v1/email-template/#{id}", api_key: client.api_key, name: name, html: html ) end def delete(client:, id:) client.conn.delete( "/api/v1/email-template/#{id}", api_key: client.api_key ) end def clone(client:, id:, name:) client.conn.post( "/api/v1/email-template/#{id}/clone", api_key: client.api_key, name: name ) end def render(client:, id:, context:) client.conn.post( "/api/v1/email-template/#{id}/render", api_key: client.api_key, context: context ) end def render_and_send( client:, id:, context:, service:, from_email:, from_name:, subject:, to: ) client.conn.post( "/api/v1/email-template/#{id}/send", api_key: client.api_key, context: context, service: service, from_email: from_email, from_name: from_name, subject: subject, to: to ) end end end end
Version data entries
17 entries across 17 versions & 1 rubygems