fix: extract x-postal-tag before holding

closes #2684
This commit is contained in:
Adam Cooke
2024-02-01 13:53:45 +00:00
parent 49cceaa6ca
commit 6b2bf9062d
+6 -6
View File
@@ -292,6 +292,12 @@ class UnqueueMessageJob < Postal::Job
next
end
# Extract a tag and add it to the message if one doesn't exist
if queued_message.message.tag.nil? && tag = queued_message.message.headers["x-postal-tag"]
log "#{log_prefix} Added tag #{tag.last}"
queued_message.message.update(tag: tag.last)
end
#
# If the credentials for this message is marked as holding and this isn't manual, hold it
#
@@ -312,12 +318,6 @@ class UnqueueMessageJob < Postal::Job
next
end
# Extract a tag and add it to the message if one doesn't exist
if queued_message.message.tag.nil? && tag = queued_message.message.headers["x-postal-tag"]
log "#{log_prefix} Added tag #{tag.last}"
queued_message.message.update(tag: tag.last)
end
# Parse the content of the message as appropriate
if queued_message.message.should_parse?
log "#{log_prefix} Parsing message content as it hasn't been parsed before"