Sha256: 07f6876ca2f20be8b78252eebd9028e8fb581697628cb9bab6f1920ee7a809fc

Contents?: true

Size: 1.13 KB

Versions: 1

Compression:

Stored size: 1.13 KB

Contents

def process_email_addresses context_card, format_args, args
  format(format_args).render_email_addresses(args.merge(context: context_card))
end

format do
  def chunk_list  # turn off autodetection of uri's
    :references
  end
end

format :html do
  def pointer_items args
    card.item_names(context: :raw).map do |iname|
      wrap_item iname, args
    end
  end
end

format :email_text do
  view :email_addresses, cache: :never do |args|
    context = args[:context] || self
    card.item_names(context: context.name).map do |item_name|
      # note that context is processed twice here because pointers absolutize
      # item_names by default while other types can return relative names.
      # That's poor default behavior and should be fixed!
      item_name = item_name.to_name.absolute(context).to_s
      if item_name =~ /.+\@.+\..+/
        item_name
      elsif (item_card = Card.fetch(item_name))
        if item_card.account
          item_card.account.email
        else
          item_card.contextual_content(context, format: :email_text)
                   .split(/[,\n]/)
        end
      end
    end.flatten.compact.join(", ")
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
card-1.93.0 mod/notifications/set/right/bcc.rb