mail = ActionMailer::Base.deliveries.last
text = "Text of link"
body = Nokogiri::HTML(mail.body.raw_source)
link = body.at_xpath("//a[text()=\"#{text}\"]")
link["href"]
Feb 14, 2025
mail = ActionMailer::Base.deliveries.last
text = "Text of link"
body = Nokogiri::HTML(mail.body.raw_source)
link = body.at_xpath("//a[text()=\"#{text}\"]")
link["href"]