Class: MarketingActivitiesController

Inherits:
ShopifyApp::ExtensionVerificationController show all
Defined in:
lib/generators/shopify_app/add_marketing_activity_extension/templates/marketing_activities_controller.rb

Instance Method Summary collapse

Instance Method Details

#createObject



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

#deleteObject



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

#errorsObject



54
55
56
57
58
59
60
61
# File 'lib/generators/shopify_app/add_marketing_activity_extension/templates/marketing_activities_controller.rb', line 54

def errors
  request_id = params[:request_id]
  message = params[:message]

  Rails.logger.info("[Marketing Activity App Error Feedback] Request id: #{request_id}, message: #{message}")

  render(json: {}, status: :ok)
end

#pauseObject



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_dataObject



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

#previewObject



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

#republishObject



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

#resumeObject



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

#updateObject



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