override userdefinedform subject line

<%- if @topic_view.topic.tags.present? %>
<%= t 'js.tagging.tags' %>: <%- @topic_view.topic.tags.each do |t| %> <%= t %> <%- end %>
<% end %>

Hi all, how can I overwrite userdefinedform subject line, I currently have an extension for UserdefinedformController like this:

public function updateEmailData(&$emailData, $email, $recipient)
{
foreach ($emailData[‘Fields’] as $field) {
if ($field->Title == ‘Email’) {
$value = $field->Value;
$subject = ‘Email is coming from’ . $value;
}
}

    $email->setSubject($subject);
}