Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

public_submission_accounts is empty while send_notifications method is called #1142

Closed
adam-pl opened this issue Apr 29, 2016 · 2 comments
Closed
Labels

Comments

@adam-pl
Copy link

adam-pl commented Apr 29, 2016

  1. I use engine 3.1.0 on production.

  2. My content_type has turned on public_submission_enabled option:

    public_submission_enabled: true
    public_submission_accounts: ['my-name1@koala.pl', 'my-name-2@koala.pl']
    
  3. I use a form that adds new entry on form submission.

  4. I expect to get email notification on submission.
    Unfortunately I do not get any message.

  5. I've edited file locomotive-3.1.0/app/services/locomotive/content_entry_service.rb and added some logs like that:

   def send_notifications(entry)
      return unless self.content_type.public_submission_enabled?

      account_ids = (self.content_type.public_submission_accounts || []).map(&:to_s)
 puts "  account_ids: #{account_ids}"

      self.content_type.site.accounts.each do |account|
        next unless account_ids.include?(account._id.to_s)

        Locomotive::Notifications.new_content_entry(account, entry).deliver
      end
    end

Unfortunately account_ids is empty.

self.content_type.site.accounts also empty.

Any advice?

@adam-pl
Copy link
Author

adam-pl commented May 11, 2016

I've found that in the backoffice I have to add emails in "models / my_content_type / notification settings" first.

I need to check it again.

@did
Copy link
Member

did commented May 11, 2016

hey @adam-pl, I'm not sure the public_submission_accounts site property in Wagon can be pushed (it certainly is for the first deployment).

@did did closed this as completed May 11, 2016
@did did added the question label May 11, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants