# replace links by embedded-links belinging the same client oner of the result.
def self.apply_embedded_links(body, r)
p = r.pipeline
c = p.user.client
return body if p.ats_tracking_mode.to_i != Pipeline::TRACKING_MODE_EMBEDDED_LINKS
# If the body has links that matches with the URL of any embedded links belonging to the same client,
# then replace the link by the embedded link.
body.scan(BlackStack::Strings::MATCH_URL).map {
|url| url.join
}.each { |url|
e = client.embedded_links.select { |e| e.url == url }.first
if !e.nil?
body.gsub!(url, e.embedded_url)
end # if
}
body
end
This is the piece of code failing:
./lib/prospecting/message.rb:74.
Error: Undefined
client