Open petebytes opened 4 years ago
@luk4s If you can provide some direction I will work on adding segments. https://developer.mautic.org/#add-contact-to-a-segment
Hi,
basically for add
and remove
contact to/from segment, implement instance methods in https://github.com/luk4s/mautic-rails/blob/master/app/models/mautic/contact.rb model.
For example:
# @param [Integer] segment_id
def add_to_segment(segment_id)
json = @connection.request(:post, "api//segments/#{segment_id}/contact/#{id}/add", body: {})
json&.[] "success"
end
For describe REST of segments https://developer.mautic.org/#segments is best way defined new class Mautic::Segment
(for example similar to https://github.com/luk4s/mautic-rails/blob/master/app/models/mautic/form.rb).
If you are interest in implemtn feature of add contacts to segement or remove them, I think best way is do them as a class methods in Segment
model.
so, my suggestions:
Segment
classCreate WIP pull requests, I will help and check it continually (based on time 🙂 )
Unable to list, add, remove segments