I spent last week doing a similar job.
IMHO, the only way to do this is to chop out the rot until you get to good wood, square off the cavity and then fit replacement timber in. Glue it and screw it, then use some two part filler to tidy it up. Otherwise the rot will return (well, it never...