Class: MarketingActivitiesController
- Inherits:
-
ShopifyApp::ExtensionVerificationController
- Object
- ActionController::Base
- ShopifyApp::ExtensionVerificationController
- MarketingActivitiesController
- Defined in:
- lib/generators/shopify_app/add_marketing_activity_extension/templates/marketing_activities_controller.rb
Instance Method Summary collapse
- #create ⇒ Object
- #delete ⇒ Object
- #errors ⇒ Object
- #pause ⇒ Object
- #preload_form_data ⇒ Object
- #preview ⇒ Object
- #republish ⇒ Object
- #resume ⇒ Object
- #update ⇒ Object
Instance Method Details
#create ⇒ Object
46 47 48 |
# File 'lib/generators/shopify_app/add_marketing_activity_extension/templates/marketing_activities_controller.rb', line 46 def create render(json: {}, status: :ok) end |
#delete ⇒ Object
23 24 25 |
# File 'lib/generators/shopify_app/add_marketing_activity_extension/templates/marketing_activities_controller.rb', line 23 def delete render(json: {}, status: :accepted) end |
#errors ⇒ Object
54 55 56 57 58 59 60 61 62 |
# File 'lib/generators/shopify_app/add_marketing_activity_extension/templates/marketing_activities_controller.rb', line 54 def errors request_id = params[:request_id] = params[:message] ShopifyApp::Logger.info("[Marketing Activity App Error Feedback]"\ "Request id: #{request_id}, message: #{}") render(json: {}, status: :ok) end |
#pause ⇒ Object
15 16 17 |
# File 'lib/generators/shopify_app/add_marketing_activity_extension/templates/marketing_activities_controller.rb', line 15 def pause render(json: {}, status: :accepted) end |
#preload_form_data ⇒ Object
4 5 6 7 8 9 |
# File 'lib/generators/shopify_app/add_marketing_activity_extension/templates/marketing_activities_controller.rb', line 4 def preload_form_data preload_data = { "form_data": {}, } render(json: preload_data, status: :ok) end |
#preview ⇒ Object
27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 |
# File 'lib/generators/shopify_app/add_marketing_activity_extension/templates/marketing_activities_controller.rb', line 27 def preview placeholder_img = "https://cdn.shopify.com/s/files/1/0533/2089/files/placeholder-images-image_small.png" preview_response = { "desktop": { "preview_url": placeholder_img, "content_type": "text/html", "width": 360, "height": 200, }, "mobile": { "preview_url": placeholder_img, "content_type": "text/html", "width": 360, "height": 200, }, } render(json: preview_response, status: :ok) end |
#republish ⇒ Object
50 51 52 |
# File 'lib/generators/shopify_app/add_marketing_activity_extension/templates/marketing_activities_controller.rb', line 50 def republish render(json: {}, status: :accepted) end |
#resume ⇒ Object
19 20 21 |
# File 'lib/generators/shopify_app/add_marketing_activity_extension/templates/marketing_activities_controller.rb', line 19 def resume render(json: {}, status: :accepted) end |
#update ⇒ Object
11 12 13 |
# File 'lib/generators/shopify_app/add_marketing_activity_extension/templates/marketing_activities_controller.rb', line 11 def update render(json: {}, status: :accepted) end |