Skip to content

Suppressible ​

Missive::Suppressible flags a record as suppressed instead of deleting it, keeping a history of bounces, complaints and unsubscriptions. It's included in Subscriber, Subscription and Dispatch.

Columns ​

ColumnTypeNotes
suppressed_attimestampbacks the suppressed boolean
suppression_reasonintegerenum, required when suppressed

Suppression reasons ​

The suppression_reason enum matches Postmark's suppression reasons:

ValuePostmark reason
hard_bounceHardBounce
spam_complaintSpamComplaint
manual_suppressionManualSuppression (e.g. the recipient used an unsubscribe link)

Scopes ​

  • suppressed: records with a suppressed_at
  • not_suppressed: records without one

Methods ​

MethodEffect
suppress!(reason:)sets suppressed_at to now and suppression_reason, then saves
unsuppress!clears suppressed_at and suppression_reason
suppressed?true when suppressed_at is set and in the past

The enum also generates the usual predicates and scopes, such as hard_bounce? and Missive::Subscriber.spam_complaint.

Released under the MIT License.