class InviteMember < Invitation settings_items :community_id, :type => :integer validates_presence_of :community_id def community Community.find(community_id) end def community=(newcommunity) community_id = newcommunity.id end def perform community.add_member(friend) end def title _("Community invitation") end def linked_subject {:text => community.name, :url => community.public_profile_url} end def information {:message => _('%{requestor} invited you to join %{linked_subject}.')} end def url community.url end def icon {:type => :profile_image, :profile => community, :url => community.url} end def expanded_message super.gsub //, community.name end # Default message send to friend when user use invite a friend feature def self.mail_template [ _('Hello ,'), _(' is inviting you to join "" on .'), _('To accept the invitation, please follow this link:'), '', "--\n", ].join("\n\n") end end